Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AngularJS: Tipps and Tricks for $provide

jowe
February 13, 2014

AngularJS: Tipps and Tricks for $provide

Donnerstagsvortrag Lightning Talk von @MJantke

jowe

February 13, 2014
Tweet

More Decks by jowe

Other Decks in Programming

Transcript

  1. What is $provide? ‣ API to fill DI-container ‣ Configures

    the $injector ‣ Uses strategies for varying services called recipes ‣ Most functionality is exposed to angular.Module
  2. What is $injector? ‣ Holds the container ‣ API to

    interact with DI-container ‣ Resolves requested dependencies for services ‣ Knows how to instantiate objects and how to invoke functions
  3. Recipes ‣ constant() - define constant for configuration ‣ value()

    - define value, get value ‣ factory() - use the module pattern ‣ service() - pass constructor, get object ‣ decorator() - intercept and extend ‣ provider() - write your configurable factory