ngInit

directive in module ng The ngInit directive allows you to evaluate an expression in the current scope. This directive can be abused to add unnecessary amounts of logic into your templates. There are only a few appropriate uses of ngInit, such as for aliasing special properties of ngRepeat, as seen in the demo below; and for injecting data via server side scripting. Besides these few cases, you should use controllers rather than ngInit to initialize values on a scope. Note: If you have a

angular.equals

function in module ng Determines if two objects or two values are equivalent. Supports value types, regular expressions, arrays and objects. Two objects or values are considered equivalent if at least one of the following is true: Both objects or values pass === comparison. Both objects or values are of the same type and all of their properties are equal by comparing them with angular.equals. Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal) Bot

$location.search()

search(search, [paramValue]); This method is getter / setter. Return search part (as object) of current url when called without any parameter. Change search part when called with parameter and return $location. // given url http://example.com/#/some/path?foo=bar&baz=xoxo var searchObject = $location.search(); // => {foo: 'bar', baz: 'xoxo'} // set foo to 'yipee' $location.search('foo', 'yipee'); // $location.search() => {foo: 'yipee', baz: 'xoxo'} Parameters Param Type Details se

ngController

directive in module ng The ngController directive attaches a controller class to the view. This is a key aspect of how angular supports the principles behind the Model-View-Controller design pattern. MVC components in angular: Model â Models are the properties of a scope; scopes are attached to the DOM where scope properties are accessed through bindings. View â The template (HTML with data bindings) that is rendered into the View. Controller â The ngController directive specifies a Contro

$parse

$parseProvider service in module ng Converts Angular expression into a function. var getter = $parse('user.name'); var setter = getter.assign; var context = {user:{name:'angular'}}; var locals = {user:{name:'local'}}; expect(getter(context)).toEqual('angular'); setter(context, 'newValue'); expect(context.user.name).toEqual('newValue'); expect(getter(context, locals)).toEqual('local'); Usage $parse(expression); Arguments Param Type Details expression string String expression to c

ngMouseup

directive in module ng Specify custom behavior on mouseup event. Directive Info This directive executes at priority level 0. Usage as attribute: <ANY ng-mouseup="expression"> ... </ANY> Arguments Param Type Details ngMouseup expression Expression to evaluate upon mouseup. (Event object is available as $event)

$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

ngMock.$httpBackend.expectHEAD()

expectHEAD(url, [headers], [keys]); Creates a new request expectation for HEAD 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. headers (optional) Object HTTP headers. keys (optional) Array Array of keys to assign to regex matches in request url described above. Returns requestHandler Returns an object with respond method

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

ngMockE2E.$httpBackend.whenHEAD()

whenHEAD(url, [headers], [keys]); Creates a new backend definition for HEAD 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. headers (optional) Objectfunction(Object) HTTP headers. keys (optional) Array Array of keys to assign to regex matches in request url described on $httpBackend mock. Returns requestHandler Returns an