ngSanitize

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

ngMockE2E.$httpBackend.whenJSONP()

whenJSONP(url, [keys]); Creates a new backend definition for JSONP 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. keys (optional) Array Array of keys to assign to regex matches in request url described on $httpBackend mock. Returns requestHandler Returns an object with respond and passThrough methods that control how a matched

ngMock.type

Name Description angular.mock.TzDate NOTE: this is not an injectable instance, just a globally available mock class of Date. $rootScope.Scope Scope type decorated with helper methods useful for testing. These methods are automatically available on any Scope instance when ngMock module is loaded.

ngMock.angular.mock.module.sharedInjector

function in module ngMock NOTE: This function is declared ONLY WHEN running tests with jasmine or mocha This function ensures a single injector will be used for all tests in a given describe context. This contrasts with the default behaviour where a new injector is created per test case. Use sharedInjector when you want to take advantage of Jasmine's beforeAll(), or mocha's before() methods. Call module.sharedInjector() before you setup any other hooks that will create (i.e call module())

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

$location.state()

state([state]); This method is getter / setter. Return the history state object when called without any parameter. Change the history state object when called with one parameter and return $location. The state object is later passed to pushState or replaceState. NOTE: This method is supported only in HTML5 mode and only in browsers supporting the HTML5 History API (i.e. methods pushState and replaceState). If you need to support older browsers (like IE9 or Android < 4.0), don't use this met

ngMock.$httpBackend.expectPUT()

expectPUT(url, [data], [headers], [keys]); Creates a new request expectation for PUT requests. For more info see expect(). 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. data (optional) stringRegExpfunction(string)Object HTTP request body or function that receives data string and returns true if the data is as expected, or Object if request body is in JSON format.

$animate.pin()

pin(element, parentElement); Associates the provided element with a host parent element to allow the element to be animated even if it exists outside of the DOM structure of the Angular application. By doing so, any animation triggered via $animate can be issued on the element despite being outside the realm of the application or within another application. Say for example if the application was bootstrapped on an element that is somewhere inside of the <body> tag, but we wanted to allow

$sce.getTrustedJs()

getTrustedJs(value); Shorthand method. $sce.getTrustedJs(value) â $sceDelegate.getTrusted($sce.JS, value) Parameters Param Type Details value * The value to pass to $sce.getTrusted. Returns * The return value of $sce.getTrusted($sce.JS, value)

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.