Guide: Running in Production

There are a few things you might consider when running your AngularJS application in production. Disabling Debug Data By default AngularJS attaches information about binding and scopes to DOM nodes, and adds CSS classes to data-bound elements: As a result of ngBind, ngBindHtml or {{...}} interpolations, binding data and CSS class ng-binding are attached to the corresponding element. Where the compiler has created a new scope, the scope and either ng-scope or ng-isolated-scope CSS class are a

ngModel.NgModelController.$name

$name string The name attribute of the control.

ngMockE2E.$httpBackend

service in module ngMockE2E Fake HTTP backend implementation suitable for end-to-end testing or backend-less development of applications that use the $http service. Note: For fake http backend implementation suitable for unit testing please see unit-testing $httpBackend mock. This implementation can be used to respond with static or dynamic responses via the when api and its shortcuts (whenGET, whenPOST, etc) and optionally pass through requests to the real $httpBackend for specific reques

ngCookies.$cookies.get()

get(key); Returns the value of given cookie key Parameters Param Type Details key string Id to use for lookup. Returns string Raw cookie value.

ngModel.NgModelController.$setViewValue()

$setViewValue(value, trigger); Update the view value. This method should be called when a control wants to change the view value; typically, this is done from within a DOM event handler. For example, the input directive calls it when the value of the input changes and select calls it when an option is selected. When $setViewValue is called, the new value will be staged for committing through the $parsers and $validators pipelines. If there are no special ngModelOptions specified then the stage

$cacheFactory.Cache.remove()

remove(key); Removes an entry from the Cache object. Parameters Param Type Details key string the key of the entry to be removed

ngRepeat

directive in module ng The ngRepeat directive instantiates a template once per item from a collection. Each template instance gets its own scope, where the given loop variable is set to the current collection item, and $index is set to the item index or key. Special properties are exposed on the local scope of each template instance, including: Variable Type Details $index number iterator offset of the repeated element (0..length-1) $first boolean true if the repeated element is first in t

ngMock.$log.assertEmpty()

assertEmpty(); Assert that all of the logging methods have no logged messages. If any messages are present, an exception is thrown.

angular.bootstrap

function in module ng Use this function to manually start up angular application. For more information, see the Bootstrap guide. Angular will detect if it has been loaded into the browser more than once and only allow the first loaded script to be bootstrapped and will report a warning to the browser console for each of the subsequent scripts. This prevents strange results in applications, where otherwise multiple instances of Angular try to work on the DOM. Note: Protractor based end-to-

$log.debug()

debug(); Write a debug message