顯示具有 factory 標籤的文章。 顯示所有文章
顯示具有 factory 標籤的文章。 顯示所有文章

2015年1月14日 星期三

[AngularJS] Basic Concepts

Here are the basic concepts of Angularjs, these concepts are barely well documented by the officials.

  1. angular.config only accepts providers
  2. Every service and factory are the instances of the providers

    e.g.
    angular.module('myApp')
      .service('FooService', function(){
        //...etc
      })
      .config(function(FooServiceProvider){
        //...etc
      });
    
    
    
    Reference: http://stackoverflow.com/questions/17485900/injecting-dependencies-in-config-modules-angularjs