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.

ngCookies.$cookies

$cookiesProvider service in module ngCookies Provides read/write access to browser's cookies. Up until Angular 1.3, $cookies exposed properties that represented the current browser cookie values. In version 1.4, this behavior has changed, and $cookies now provides a standard api of getters, setters etc. Requires the ngCookies module to be installed. Methods get(key); Returns the value of given cookie key Parameters Param Type Details key string Id to use for lookup. Returns

$compileProvider.directive()

directive(name, directiveFactory); Register a new directive with the compiler. Parameters Param Type Details name stringObject Name of the directive in camel-case (i.e. ngBind which will match as ng-bind), or an object map of directives where the keys are the names and the values are the factories. directiveFactory function()Array An injectable directive factory function. See the directive guide and the compile API for more info. Returns ng.$compileProvider Self for chaining.

$sce.getTrustedResourceUrl()

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

input[url]

input in module ng Text input with URL validation. Sets the url validation error key if the content is not a valid URL. Note: input[url] uses a regex to validate urls that is derived from the regex used in Chromium. If you need stricter validation, you can use ng-pattern or modify the built-in validators (see the Forms guide) Directive Info This directive executes at priority level 0. Usage <input type="url" ng-model="string" [name="string"] [required="string"]

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

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

$httpParamSerializerJQLike

service in module ng Alternative $http params serializer that follows jQuery's param() method logic. The serializer will also sort the params alphabetically. To use it for serializing $http request parameters, set it as the paramSerializer property: $http({ url: myUrl, method: 'GET', params: myParams, paramSerializer: '$httpParamSerializerJQLike' }); It is also possible to set it as the default paramSerializer in the $httpProvider. Additionally, you can inject the serializer and u

$cacheFactory

service in module ng Factory that constructs Cache objects and gives access to them. var cache = $cacheFactory('cacheId'); expect($cacheFactory.get('cacheId')).toBe(cache); expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined(); cache.put("key", "value"); cache.put("another key", "another value"); // We've specified no options on creation expect(cache.info()).toEqual({id: 'cacheId', size: 2}); Usage $cacheFactory(cacheId, [options]); Arguments Param Type Details cacheId strin

input[week]

input in module ng Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 week format (yyyy-W##), for example: 2013-W02. The model must always be a Date object, otherwise Angular will throw an error. Invalid Date objects (dates whose getTime() is NaN) will be rendered as an empty string. The timezone to be used to read/write the Date