ngMock.$rootScope.Scope.$countChildScopes()

$countChildScopes(); Counts all the direct and indirect child scopes of the current scope. The current scope is excluded from the count. The count includes all isolate child scopes. Returns number Total number of child scopes.

$compileProvider.aHrefSanitizationWhitelist()

aHrefSanitizationWhitelist([regexp]); Retrieves or overrides the default regular expression that is used for whitelisting of safe urls during a[href] sanitization. The sanitization is a security measure aimed at preventing XSS attacks via html links. Any url about to be assigned to a[href] via data-binding is first normalized and turned into an absolute url. Afterwards, the url is matched against the aHrefSanitizationWhitelist regular expression. If a match is found, the original url is writte

$log.warn()

warn(); Write a warning message

auto.$injector.invoke()

invoke(fn, [self], [locals]); Invoke the method and supply the method arguments from the $injector. Parameters Param Type Details fn function()Array.<(string|function())> The injectable function to invoke. Function parameters are injected according to the $inject Annotation rules. self (optional) Object The this for the invoked method. locals (optional) Object Optional object. If preset then any argument names are read from this object first, before the $injector is con

$rootScope.Scope

type in module ng A root scope can be retrieved using the $rootScope key from the $injector. Child scopes are created using the $new() method. (Most scopes are created automatically when compiled HTML template is executed.) See also the Scopes guide for an in-depth introduction and usage examples. Inheritance A scope can inherit from a parent scope, as in this example: var parent = $rootScope; var child = parent.$new(); parent.salutation = "Hello"; expect(child.salutation).toEqual('Hello'

Guide: Modules

You can think of a module as a container for the different parts of your app â controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable mod

Guide: Conceptual Overview

This section briefly touches on all of the important parts of AngularJS using a simple example. For a more in-depth explanation, see the tutorial. Concept Description Template HTML with additional markup Directives extend HTML with custom attributes and elements Model the data shown to the user in the view and with which the user interacts Scope context where the model is stored so that controllers, directives and expressions can access it Expressions access variables and functions from the sco

form.FormController

type in module ng FormController keeps track of all its controls and nested forms as well as the state of them, such as being valid/invalid or dirty/pristine. Each form directive creates an instance of FormController. Methods $rollbackViewValue(); Rollback all form controls pending updates to the $modelValue. Updates may be pending by a debounced event or because the input is waiting for a some future event defined in ng-model-options. This method is typically needed by the reset butto

ngFocus

directive in module ng Specify custom behavior on focus event. Note: As the focus event is executed synchronously when calling input.focus() AngularJS executes the expression using scope.$evalAsync if the event is fired during an $apply to ensure a consistent state. Directive Info This directive executes at priority level 0. Usage as attribute: <window, input, select, textarea, a ng-focus="expression"> ... </window, input, select, textarea, a> Arguments Param Type Detail

auto.$provide.decorator()

decorator(name, decorator); Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behavior of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service. Parameters Param Type Details name string The name of the service to decorate. decorator function()Array.<(string|function())> Th