$q.when()

when(value, [successCallback], [errorCallback], [progressCallback]); Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. Parameters Param Type Details value * Value or a promise successCallback (optional) Function= errorCallback (optional) Function= progressCallback (optional) Function

$q.defer()

defer(); Creates a Deferred object which represents a task which will finish in the future. Returns Deferred Returns a new instance of deferred.

$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

$q.all()

all(promises); Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. Parameters Param Type Details promises Array.<Promise>Object.<Promise> An array or hash of promises. Returns Promise Returns a single promise that will be resolved with an array/hash of values, each value corresponding to the promise at the same index/key in the promises array/hash. If any of the promises is resolved with a rejection, this resultin

$parseProvider.addLiteral()

addLiteral(literalName, literalValue); Configure $parse service to add literal values that will be present as literal at expressions. Parameters Param Type Details literalName string Token for the literal value. The literal name value must be a valid literal name. literalValue * Value for this literal. All literal values must be primitives or undefined.

$parseProvider

$parse provider in module ng $parseProvider can be used for configuring the default behavior of the $parse service. Methods addLiteral(literalName, literalValue); Configure $parse service to add literal values that will be present as literal at expressions. Parameters Param Type Details literalName string Token for the literal value. The literal name value must be a valid literal name. literalValue * Value for this literal. All literal values must be primitives or undefin

$log.log()

log(); Write a log message

$log.info()

info(); Write an information message

$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

$logProvider

$log provider in module ng Use the $logProvider to configure how the application logs messages Methods debugEnabled([flag]); Parameters Param Type Details flag (optional) boolean enable or disable debug level messages Returns * current value if used as getter or itself (chaining) if used as setter