ngMock.$controller

service in module ngMock A decorator for $controller with additional bindings parameter, useful when testing controllers of directives that use bindToController. // Directive definition ... myMod.directive('myDirective', { controller: 'MyDirectiveController', bindToController: { name: '@' } }); // Controller definition ... myMod.controller('MyDirectiveController', ['$log', function($log) { $log.info(this.name); }]); // In a test ... describe('myDirectiveController', fun

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.$animate.flush()

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 running animation (see closeAndFlush() for that).

ngMock.$animate.closeAndFlush()

closeAndFlush(); This method will close all pending animations (both Javascript and CSS) and it will also flush any remaining animation frames and/or callbacks.

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

Installation First include angular-mocks.js in your HTML: <script src="angular.js"> <script src="angular-mocks.js"> You can download this file from the following places: Google CDN e.g. //ajax.googleapis.com/ajax/libs/angularjs/X.Y.Z/angular-mocks.js Bower e.g. bower install angular-mocks@X.Y.Z code.angularjs.org e.g. "//code.angularjs.org/X.Y.Z/angular-mocks.js" where X.Y.Z is the AngularJS version you are running. Then load the module in your application by adding it as a

ngMinlength

directive in module ng ngMinlength adds the minlength validator to ngModel. It is most often used for text-based input controls, but can also be applied to custom text-based controls. The validator sets the minlength error key if the ngModel.$viewValue is shorter than the integer obtained by evaluating the Angular expression given in the ngMinlength attribute value. Note: This directive is also added when the plain minlength attribute is used, with two differences: ngMinlength does not s

ngMessages.ngMessagesInclude

directive in module ngMessages ngMessagesInclude is a directive with the purpose to import existing ngMessage template code from a remote template and place the downloaded template code into the exact spot that the ngMessagesInclude directive is placed within the ngMessages container. This allows for a series of pre-defined messages to be reused and also allows for the developer to determine what messages are overridden due to the placement of the ngMessagesInclude directive. Directive I

ngMessages.ngMessages

directive in module ngMessages ngMessages is a directive that is designed to show and hide messages based on the state of a key/value object that it listens on. The directive itself complements error message reporting with the ngModel $error object (which stores a key/value state of validation errors). ngMessages manages the state of internal messages within its container element. The internal messages use the ngMessage directive and will be inserted/removed from the page depending on if t

ngMessages.ngMessageExp

directive in module ngMessages ngMessageExp is a directive with the purpose to show and hide a particular message. For ngMessageExp to operate, a parent ngMessages directive on a parent DOM element must be situated since it determines which messages are visible based on the state of the provided key/value map that ngMessages listens on. Directive Info This directive creates new scope. This directive executes at priority level 1. Usage <!-- using attribute directives --> <ANY ng