var myTestApp=angular.module('myApp',[]);
myTestApp
.controller('MyController',
['$scope', 'EmailParser',
function($scope, EmailParser) {
...}]);
angular.module('myApp', ['emailParser'])
.controller('MyController',
['$scope', 'EmailParser',
function($scope, EmailParser) {...}]);
I will encounter error when I use above method to add the dependency of emailParser
into an agular module. What is the right way to do it?
NOTE: emailParser
is declared in the actual code
Update
I don't want certain controller have access to email Parser module. I am not sure if this kind of thinking is right. What is the best practice for adding dependency after the declaration of module at the beginning? Am I going the right way to do it?
The error I received was
Error: [ng:areq] Argument 'MyController' is not a function, got undefined
I am sure if my way of thinking how it work is right. Is that I want add emailParser into the module not a good idea, or not a good practice?
Thank You