June 2014
Intermediate to advanced
696 pages
38h 52m
English
Controllers are pieces of code that are intended to provide business logic by augmenting scope. You create controllers by using the controller() method on the Model object of an application. This function registers a controller as a provider in the module, but it does not create an instance of the controller. That occurs when the ng-controller directive is linked in an AngularJS template.
The controller() method accepts the controller name as the first parameter and an array of dependencies as the second parameter. For example, the following code defines a controller that uses dependency injection to access a value provider named start:
angular.module('myApp', []). ...
Read now
Unlock full access