Dependency Injection with AngularJS by Alex Knol

Dependency Injection with AngularJS by Alex Knol

Author:Alex Knol [Alex Knol]
Language: eng
Format: epub, pdf
Tags: AngularJS, Packt
Publisher: Packt Publishing
Published: 0101-01-01T00:00:00+00:00


These are essentially the same definitions and don't cause pollution in the global scope. The second difference that you may have noticed is in the way the dependencies are injected in the function. At the time of writing this book, most, if not all of the examples on the AngularJs website use the simple injection method. The dependencies are just parameters in the function definitions. Magically, Angular is able to figure out which parameter is what by the name because the order does not matter. So the preceding example could be rewritten as follows, and it would still function correctly:

// reversedangularJs home page JavaScript Projects example functionListCtrl( Project, Scope ) { $scope.projects = Project.query(); }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.