0
我正在嘗試在另一個客戶指令的模板中添加一個自定義指令,但不顯示該模板。使用下面的代碼。我究竟做錯了什麼?另一個指令模板中的指令
app.js
var app = angular.module('myApp', []);
app.directive('container', function() {
return {
restrict: 'A',
scope: {},
replace: true,
template: '<div my-dir-one></div>',
link: function (scope, elm) {
}
}
});
app.directive('myDirOne', function() {
return {
restrict: 'A',
scope: {},
replace: true,
template: '<div>This is directive one.</div>'
}
});
HTML:
<div container></div>
這是我的實際問題http://stackoverflow.com/questions/31214894/nested-directive-within-ngview-does-not-work-angular-js – MNVR