Angularjs call custom directive of modular1 in modular2

Posted by Syedshakeer under AngularJS on 8/18/2016 | Points: 10 | Views : 272 | Status : [Member] | Replies : 2
Hi,
Can we call custom directive of myModule1 in myModule2?

//file1.js
var app=angular.module("myModule1 ",[]);

app.directive('mydirective1 ',function(){

// template

});



//file2.js
call above mydirective1 in myModule2.
Var app=angular.module('myModule2 ',['myModule1 ']);


Syed Shakeer Hussain


Responses

Posted by: Rajnilari2015 on: 8/18/2016 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 25

Up
0
Down
You can use a callback function. An example http://jsfiddle.net/fmvh7vht/

Hope that helps

--
Thanks & Regards,
RNA Team

Syedshakeer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Syedshakeer on: 8/18/2016 [Member] Starter | Points: 25

Up
0
Down
Hi ,

I want to combine of directive of myModule1 in to custom Directive of myModule2.




Syed Shakeer Hussain

Syedshakeer, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response