ngBindTemplate

directive in module ng The ngBindTemplate directive specifies that the element text content should be replaced with the interpolation of the template in the ngBindTemplate attribute. Unlike ngBind, the ngBindTemplate can contain multiple {{ }} expressions. This directive is needed since some HTML elements (such as TITLE and OPTION) cannot contain SPAN elements. Directive Info This directive executes at priority level 0. Usage as attribute: <ANY ng-bind-template="string"> ... <

angular.isDefined

function in module ng Determines if a reference is defined. Usage angular.isDefined(value); Arguments Param Type Details value * Reference to check. Returns boolean True if value is defined.

currency

filter in module ng Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default symbol for current locale is used. Usage In HTML Template Binding {{ currency_expression | currency : symbol : fractionSize}} In JavaScript $filter('currency')(amount, symbol, fractionSize) Arguments Param Type Details amount number Input to filter. symbol (optional) string Currency symbol or identifier to be displayed. fractionSize (optional) number Number of

Guide: Unit Testing

Improve this Doc JavaScript is a dynamically typed language which comes with great power of expression, but it also comes with almost no help from the compiler. For this reason we feel very strongly that any code written in JavaScript needs to come with a strong set of tests. We have built many features into Angular which make testing your Angular applications easy. With Angular, there is no excuse for not testing. Separation of Concerns Unit testing, as the name implies, is about testing ind

ngModel.NgModelController.$render()

$render(); Called when the view needs to be updated. It is expected that the user of the ng-model directive will implement this method. The $render() method is invoked in the following situations: $rollbackViewValue() is called. If we are rolling back the view value to the last committed value then $render() is called to update the input control. The value referenced by ng-model is changed programmatically and both the $modelValue and the $viewValue are different from last time. Since ng-mode

ngMock.$animate

service in module ngMock Mock implementation of the $animate service. Exposes two additional methods for testing animations. Methods closeAndFlush(); This method will close all pending animations (both Javascript and CSS) and it will also flush any remaining animation frames and/or callbacks. flush(); This method is used to flush the pending callbacks and animation frames to either start an animation or conclude an animation. Note that this will not actually close an actively runni

ngMock.$componentController

service in module ngMock A service that can be used to create instances of component controllers. Be aware that the controller will be instantiated and attached to the scope as specified in the component definition object. That means that you must always provide a $scope object in the locals param. Usage $componentController(componentName, locals, [bindings], [ident]); Arguments Param Type Details componentName string the name of the component whose controller we want to instantia

ngMock.$httpBackend.whenDELETE()

whenDELETE(url, [headers], [keys]); Creates a new backend definition for DELETE requests. For more info see when(). Parameters Param Type Details url stringRegExpfunction(string) HTTP url or function that receives a url and returns true if the url matches the current definition. headers (optional) Objectfunction(Object) HTTP headers. keys (optional) Array Array of keys to assign to regex matches in request url described above. Returns requestHandler Returns an object with

angular.injector

function in module ng Creates an injector object that can be used for retrieving services as well as for dependency injection (see dependency injection). Usage angular.injector(modules, [strictDi]); Arguments Param Type Details modules Array.<string|Function> A list of module functions or their aliases. See angular.module. The ng module must be explicitly added. strictDi (optional) boolean Whether the injector should be in strict mode, which disallows argument name annot

ngSanitize.linky

filter in module ngSanitize Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and plain email address links. Requires the ngSanitize module to be installed. Usage In HTML Template Binding <span ng-bind-html="linky_expression | linky"></span> In JavaScript $filter('linky')(text, target, attributes) Arguments Param Type Details text string Input text. target string Window (_blank|_self|_parent|_top) or named frame to open links