0
2つのディレクティブがあります。一つは、 "サブディレクティブ"ディレクティブ、必須、角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'を使用してください。 –