我必须插入一组属性到我想要重新使用的一个组件... 现在不同的属性将作为字符串给我... 说例如我想在我的组件动态插入html元素的角度
<input type="text" maxlength="10" placeholder="enter your name"/>
的话,我会得到所有属性为一个字符串
attr = 'type="text" maxlength="10" placeholder="enter your name"'
控制器为我的组件...
插入的元素,我需要插入到我的h中的对手TML ...
我曾尝试
<input {{attr}}/>
和
<input {{jQuery.parseHtml(attr)}}
等。
,但它无法正常工作......还,找不到任何解决方案.. 请分享任何解决方案或对我有用的链接/参考...
尝试阅读[documentation](https://angular.io/guide/template-syntax#binding-targets)。 –