javascript - How to define a controller for a directive in a separate js file? -


.directive('directivename', ['$scope', function ($scope) {     return {         restrict: 'e',         templateurl: 'templateurl/abc.html',         scope: {             name: '@',             flag: '='         },         controllerurl: 'controllerurl/xyz.html'     } }]); 

while defining directives in angularjs, there way specify url controller of directive? (similar defining templateurl) controllerurl parameter maybe?

you can create controller in file , use controller: 'name-of-controller'. make sure file controller located gets imported in index.html


Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

formula - R: how to pass in a reference to the variable in glm or lm? -