0
데코레이터를 사용하여 제 3 자 지시문을 확장하려고합니다. 데코레이터 내에서 내 공장 중 하나에 액세스하고 싶습니다. 어떻게해야합니까?AngularJS : 데코레이터 내에서 공장에 액세스
$provide.decorator('multiSelectDirective', function($delegate) {
var directive = $delegate[0],
link = directive.link;
// wipe out the shitty template
directive.template = '';
// make with the new template!
directive.templateUrl = 'app/partials/filters.template.html';
// hook into the compile phase of the directive
directive.compile = function() {
// the function returned by compile is the new link function
return function($scope, el, attrs) {
// run the original link function.
link.apply(this, arguments);
$scope.filterClicked = function(buttonName, selection) {
handleFilterClick(buttonName, selection, JiraData, GreyGooseApi);
}
}
};
return $delegate;
});