我想在Angular 1.5中实现一个简单的组件我试图访问组件mycomponentheader中的绑定(绑定)属性'compTitle'。如何访问模板内的Angular 1.5组件属性
var mycomponentheader = {
....
bindings: {
'comptitle': '@mycomptitle'
},
....
};
我在视图的html标记中传递属性值[compTitle =“encryptedTitle”]。
<mycomponentheader mycomptitle="encryptedTitle">
<div>
This is displayed for component content
</div>
</mycomponentheader>
我试着在指令中使用类似的机制。 对于相同的的jsfiddle是@https://jsfiddle.net/visibleinvisibly/4n7vsas7/
我所知定义模板属性作为一个函数,它可以与$元件和$ ATTRS(模板被注入的:在角1.5功能($元件,$ ATTRS){} )但我正在寻找其他方法。
由于提前
谢谢你的工作 – visibleinvisibly