【发布时间】:2014-12-10 20:44:07
【问题描述】:
我正在阅读精彩的 wiki 教程 https://github.com/angular/angular.js/wiki/Understanding-Directives#specialized-the-directive-configuration
我试过了
var app = angular.module('myApp', []);
app.controller('MainController',function() {
});
app.directive('one', function() {
return {
template: '<div>I am one</div>',
controller:function(){
},
link:function($scope){
}
};
});
app.directive('two', function() {
return angular.extend({}, oneDirective[0], { template: '<div>I am two</div>' });
});
但我有 ReferenceError: oneDirective is not defined
请问有什么事吗?
【问题讨论】:
-
oneDirective 没有在任何地方定义。
标签: angularjs angularjs-directive