Tag » Injector

AngularJs: Double Injectors !!

When createInjector is called to load modules, there are two injectors created they are providerInjector & instanceInjector, createInjector will return instanceInjector method. Lets look at the implementation… 127 kata lagi


AngularJs: Revisiting createInjector

In the previous posts we have seen how DI is achieved using $provider and $injector. In this post we go further details of how exactly dependencies are injected into angular. 171 kata lagi


Why won't this event handler fire?!?!

Today’s gotcha moment:

angular.module('foo').factory('FooService', function ($rootScope) {
... Blahblah, bunch of functions, including processStuff() ...
$rootScope.$on('externalEvent', processStuff);
return { processStuff: processStuff };

Looks fine, right?   108 kata lagi

Injector Codes


Quote from a DENSO document incl. picture below:

Replacing a Diesel Common Rail Injector:
When replacing a DENSO Diesel Common Rail Injector, marked with a…

642 kata lagi

AngularJs Note: $injector Vs $inject Vs Injector()

Following are the key differences:

#injector: Used to invoke or get dependencies into variables

   //gets the implementation of service called 'A' 

   //returns the value of implementation of service 'A'
… 75 kata lagi

AngularJs: Understand DI & $injector

We all know in AngularJs requried components are Dependency Injected. For example, if we need $scope in controller, we simply inject ‘$scope’ as one of the parameters to the controller function. 489 kata lagi