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.$exceptionHandler

$exceptionHandlerProvider service in module ngMock Mock implementation of $exceptionHandler that rethrows or logs errors passed to it. See $exceptionHandlerProvider for configuration information. describe('$exceptionHandlerProvider', function() { it('should capture log messages and exceptions', function() { module(function($exceptionHandlerProvider) { $exceptionHandlerProvider.mode('log'); }); inject(function($log, $exceptionHandler, $timeout) { $timeout(func

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.$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.$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

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.ngMessage

directive in module ngMessages ngMessage is a directive with the purpose to show and hide a particular message. For ngMessage 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. More information about using ngMessage can be found in the ngMessages module documentation. Directive Info This directive creates new scope. This directive exe

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.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