0

How to override directive? I want on detective call do some my action(resolve url for ex.) then give control to regular directive.

myApp.directive('ngInclude', [function () { // resolve url }]);

Update:

Here is example based on answer below: http://plnkr.co/edit/HZmyAW64xKhBsVCBkj8U?p=preview but I don't know how change detective value.

Thanks

  • possible duplicate of [AngularJS - how to override directive ngClick](http://stackoverflow.com/questions/18421732/angularjs-how-to-override-directive-ngclick) – Philipp Gayret Jun 13 '14 at 21:17

1 Answers1

0

This is done by giving your directive a higher priority, like so:

 angular.module('myApp', [])
  .directive('ngInclude', function() {
      return {
        priority: 100,
        link: function(scope, element, attr) {
          //Logic goes here
          })
       }
    }
})
Chancho
  • 1,930
  • 2
  • 15
  • 20