auto.$injector.instantiate()

instantiate(Type, [locals]);

Create a new instance of JS type. The method takes a constructor function, invokes the new operator, and supplies all of the arguments to the constructor function as specified by the constructor annotation.

Parameters

Param Type Details
Type Function

Annotated constructor function.

locals
(optional)
Object

Optional object. If preset then any argument names are read from this object first, before the $injector is consulted.

Returns

Object

new instance of Type.

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

Please login to continue.