0
有两个指令。一个是 “伪指令”指令,要求,角js
主要:
.directive('materialDropdown', function() {
// Input to directive
return {
scope: {
//'personalDb': '=',
},
transclude: true,
controllerAs: 'vm',
bindToController: true,
controller: function(){
console.log('material directive fires')
},
template: '<select></select>',
restrict: 'E',
link: function(){}
};
});
子:
.directive('materialSizeDropdown', function() {
// Input to directive
return {
require: '^^materialDropdown',
controllerAs: 'vm',
transclude: true,
bindToController: true,
controller: function(){
console.log('hello')
},
template: '<h1>fire</h1>',
restrict: 'E',
link: function(){}
};
标记:
<material-dropdown>
<material-size-dropdown></material-size-dropdown>
</material-dropdown>
的materialSizeDropdown未在标记示出,并且所述控制器被也不烧制。
我该如何解决这个问题?
我还没有使用过我自己的指令,但是在你的要求中只需要使用'materialDropdown'而不是'^^ materialDropdown'。 –