The person upstairs misunderstood the meaning of the question. He meant that one instruction requires multiple instructions. In fact, it is very simple. Just put the require instruction into an array. The code is as follows:
app.directive('directveA',function(){})
.directive('directiveB',function(){})
.directive('directiveC',function(){
return {
require:['directiveA','directiveB']
link:function(scope,element,attrs,ctrls){
var aCtrl=ctrls[0];
var bCtrl=ctrls[1];
//这样就可以访问依赖指令的控制器了
}
};
});
Let me give you a piece of code that I just used for reference:
directive:
html
The person upstairs misunderstood the meaning of the question. He meant that one instruction requires multiple instructions. In fact, it is very simple. Just put the require instruction into an array. The code is as follows: