ngMock.function

Name Description angular.mock.dump NOTE: this is not an injectable instance, just a globally available function. angular.mock.module NOTE: This function is also published on window for easy access.NOTE: This function is declared ONLY WHEN running tests with jasmine or mocha angular.mock.module.sharedInjector NOTE: This function is declared ONLY WHEN running tests with jasmine or mocha angular.mock.inject NOTE: This function is also published on window for easy access.NOTE: This function

ngCookies.$cookiesProvider.defaults

defaults Object containing default options to pass when setting cookies. The object may have following properties: path - {string} - The cookie will be available only for this path and its sub-paths. By default, this is the URL that appears in your <base> tag. domain - {string} - The cookie will be available only for this domain and its sub-domains. For security reasons the user agent will not accept the cookie if the current domain is not a sub-domain of this domain or equal to it.

$http.get()

get(url, [config]); Shortcut method to perform GET request. Parameters Param Type Details url string Relative or absolute URL specifying the destination of the request config (optional) Object Optional configuration object Returns HttpPromise Future object

json

filter in module ng Allows you to convert a JavaScript object into JSON string. This filter is mostly useful for debugging. When using the double curly {{value}} notation the binding is automatically converted to JSON. Usage In HTML Template Binding {{ json_expression | json : spacing}} In JavaScript $filter('json')(object, spacing) Arguments Param Type Details object * Any JavaScript object (including arrays and primitive types) to filter. spacing (optional) number The numbe

ngHref

directive in module ng Using Angular markup like {{hash}} in an href attribute will make the link go to the wrong URL if the user clicks it before Angular has a chance to replace the {{hash}} markup with its value. Until Angular replaces the markup the link will be broken and will most likely return a 404 error. The ngHref directive solves this problem. The wrong way to write it: <a href="http://www.gravatar.com/avatar/{{hash}}">link1</a> The correct way to write it: <a ng-

ngComponentRouter.ChildRouter

type in module ngComponentRouter This type extends the Router. Apart from the Top Level Component ($routerRootComponent) which is associated with the $rootRouter, every Routing Component is associated with a ChildRouter, which manages the routing for that Routing Component.

$httpProvider.useLegacyPromiseExtensions()

useLegacyPromiseExtensions([value]); Configure $http service to return promises without the shorthand methods success and error. This should be used to make sure that applications work without these methods. Defaults to true. If no value is specified, returns the current configured value. Parameters Param Type Details value (optional) boolean If true, $http will return a promise with the deprecated legacy success and error methods. Returns booleanObject If a value is specified, ret

$q.reject()

reject(reason); Creates a promise that is resolved as rejected with the specified reason. This api should be used to forward rejection in a chain of promises. If you are dealing with the last promise in a promise chain, you don't need to worry about it. When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of reject as the throw keyword in JavaScript. This also means that if you "catch" an error via a promise error callback and you want to forward the error to th

ngModel.NgModelController.$rollbackViewValue()

$rollbackViewValue(); Cancel an update and reset the input element's value to prevent an update to the $modelValue, which may be caused by a pending debounced event or because the input is waiting for a some future event. If you have an input that uses ng-model-options to set up debounced updates or updates that depend on special events such as blur, you can have a situation where there is a period when the $viewValue is out of sync with the ngModel's $modelValue. In this case, you can use $ro

auto.$provide.service()

service(name, constructor); Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function. Internally it looks a bit like this: { $get: function() { return $injector.instantiate(constructor); } } You should use $provide.service(class) if you define your service as a