我如何在两个相同的指令中仅包含一个指令,而其中一个已弃用功能,而另一个不被弃用?
var app = angular.module('myModule');
app.directive('myDirective1',
// returns all the needed things;
);
app.directive('myDirective1',
// returns all the needed things, plus some additional stuff;
);
如何仅返回/注册第一个myDirective1而没有第二个?
找到方法
.config(['$provide', function ($provide) {
// Returns the second registered uiGridOdataDirective from module,
// so we dont call the same functionality twice.
$provide.decorator('uiGridOdataDirective', ['$delegate', function ($delegate) {
return [ $delegate[1] ];
}]);
}]);