0
找不到指令「appContent」所需的控制器'appLeft'!Angular指令 - 未找到控制器指令
//app-nav(left)
app.directive('appLeft', function()
{
return {
restrict: 'E',
replace: false,
scope: {
leftItem: "=leftItem"
},
controller:function($scope){
this.title = $scope.leftItem;
},
templateUrl: 'res/tpl/app-left.html',
link: function (scope, ele, attr)
{
scope.toggle=function(index){
scope.leftItem[index].isShow = !scope.leftItem[index].isShow;
}
}
}
});
//app-content
app.directive('appContent',function(){
return {
require:'^appLeft',
restrict: 'E',
replace:false,
transclude:true,
scope:{},
templateUrl:'res/tpl/app-content.html',
link:function(scope,ele,attr,appLeftCtrl){
console.log(appLeftCtrl.title)
}
}
});
無法找到指令'appContent'所需的控制器'appLeft'!
您可以加入你的HTML代碼?你如何在HTML上放置/使用指令? –