Home Access directive method from the angularjs service
Reply: 0

Access directive method from the angularjs service

saranilango
1#
saranilango Published in 2017-12-07 14:48:09Z

I have method in directive here i need to access this method from angularjs service.

For Example:

Service,

angular.module('myServiceModule', []).controller('MyController', ['$scope','notify', function($scope, notify) {}]).service('notify', ['$window',function(win) {            
}]);

Directive,

angular.module('docsSimpleDirective', []).controller('Controller', ['$scope', function($scope) {}]).directive('myCustomer', function($scope) {
    $scope.enableEditor = function(){ 
    } 
    return {
        template: 
    };
});

In my project i need to access directive method from angularjs. For example i have added sample code.
In directive i have enableEditor() method i need to be access this method form my angular services.
I searched on web i did not get proper solution for accessing directive method from angular service.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.296129 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO