我用新的角度,我需要你的帮助,了解哪些是我的问题:)角度依赖性不起作用
我创建了一个简单的app.js像这样的:
(function() {
var app = angular.module('teamStats', []);
app.directive("header", function() {
return {
restrict: 'E',
templateUrl: "header.html"
};
});
app.controller('TeamController', function(){});
})();
这里没有依赖关系,我只是得到我的头index.html感谢下面的代码,这是工作!我太高兴了!
现在我想恩把指令叫我在另一个名为文件头:template.js
(function(){
var app = angular.module('template-directives', []);
app.directive("header", function() {
return {
restrict: 'E',
templateUrl: "header.html"
};
});
})();
我app.js现在是这样的:
(function() {
var app = angular.module('teamStats', ['template-directives']);
})();
我标题没有出现在我的index.html我不明白为什么..我的依赖没有正确设置?我忘了什么?
如果有人可以帮忙;)这将是非常好的! 谢谢你!
最好的问候, CUETO文森特
别的东西是你的代码错误,这从您发布的内容中看不出来。这里是你的代码工作的[plunker](http://plnkr.co/edit/zC4NhynRQxa0WW2QTU65?p=preview)。 – 2014-10-03 12:12:56
这是用我自己的代码工作的重拳,所以它是不正常的WAMP? – Vincent 2014-10-03 12:35:01
你收到任何错误吗? – 2014-10-03 12:50:16