auto.$provide.constant()

constant(name, value);

Register a constant service with the $injector, such as a string, a number, an array, an object or a function. Like the value, it is not possible to inject other services into a constant.

But unlike value, a constant can be injected into a module configuration function (see angular.Module) and it cannot be overridden by an Angular decorator.

Parameters

Param Type Details
name string

The name of the constant.

value *

The constant value.

Returns

Object

registered instance

doc_AngularJS
2016-03-29 16:11:03
Comments
Leave a Comment

Please login to continue.