AngularJS - Dependency injection in services, factories, filters etc

前端 未结 3 1973
孤城傲影
孤城傲影 2021-01-30 02:08

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

3条回答
  •  耶瑟儿~
    2021-01-30 02:42

    For the sake of completeness, here is a service example with injection:

    app.service('', ['$http', function($http) {
      this.foo = function() { ... }
    }]);
    

提交回复
热议问题