[英]Angular 1.5.x - Directive not firing
I'm practicing working with directives, and have been banging my head on this for a while now. 我正在练习使用指令,并且已经为此花了一段时间。
The code - 编码 -
angular.module('wbHeader', []);
angular.module('wbHeader').controller('wbHeaderController', ['$scope', function() {
}]);
angular.module('wbHeader').directive('wbHeader', function() {
return {
transclude: true,
restrict: 'AEC',
scope: {
},
controller: 'wbHeaderController',
templateUrl: '/modules/wb-header/header.html'
};
});
https://plnkr.co/edit/OUrCm1mGb5K0wN8u2Ke9?p=preview https://plnkr.co/edit/OUrCm1mGb5K0wN8u2Ke9?p=preview
I feel like I'm overlooking something simply, but not sure! 我觉得我只是在忽略一些东西,但不确定!
我想你应该更换wbHeader
与wbApp
在控制器的指令,并modulejs喜欢这里angular.module('wbApp').directive('wbHeader'
的指令
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.