Home > Article > Backend Development > javascript - angular自定义指令如何写
现在我有这样三段类似的代码
{{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作用域里