So I have some plugins and libraries I want to use in my angular app and (currently) I am simply referencing those functions/methods as they were intended in 99% of apps in a wa
While the already existing answers are correct and working, john papas angular style guide favors the use of the $inject service in Y091:
Filter:
app.filter('
Directive:
app.directive('', MyDirective);
MyDirective.$inject = ['$http'];
function MyDirective() {
return {
...
}
}
Factory:
app.factory('', MyFactory);
MyFactory.$inject = ['$http'];
function MyFactory() {
var shinyNewServiceInstance;
return shinyNewServiceInstance;
}
Service:
app.service('', MyService);
MyService.$inject = ['$http'];
function MyService() {
this.foo = foo;
function foo(){
...
}
}