{{planstatuse.name}}
{{_apptype.name}}
{{centerpage.name}}
我要把这三块代码写成一个自定义指令 ,但是以上代码有的有事件,有的没有事件,而且事件不一样,该如何写?var einput= angular.module(einput, []);
einput.directive('einput',function(){
return { restrict: a, template:' '+ ' '+ '{{inputlist.name}}'+'
', replace:true, scope:{ inputlistes:'=' }}
});
回复内容: 现在我有这样三段类似的代码
{{planstatuse.name}}
{{_apptype.name}}
{{centerpage.name}}
我要把这三块代码写成一个自定义指令 ,但是以上代码有的有事件,有的没有事件,而且事件不一样,该如何写?var einput= angular.module(einput, []);
einput.directive('einput',function(){
return { restrict: a, template:' '+ ' '+ '{{inputlist.name}}'+'
', replace:true, scope:{ inputlistes:'=' }}
});
你确认一下你每个要执行的函数是否都在controller作用域里
