trait Injector extends Object
Injector Service - is used to retrieve object instances as defined by provider, instantiate types, invoke methods, and load modules.
- Annotations
- @RawJSType() @native()
- See also
- Alphabetic
- By Inheritance
- Injector
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
annotate(fn: Function, strictDi: Boolean = js.native): Array[String]
Returns an array of service names which the function is requesting for injection.
Returns an array of service names which the function is requesting for injection. This API is used by the injector to determine which services need to be injected into the function when the function is invoked. There are three ways in which the function can be annotated with the needed dependencies.
- fn
Function for which dependent service names need to be retrieved as described above.
- strictDi
Disallow argument name annotation inference (default: false).
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get[T](name: String, caller: String = js.native): UndefOr[T]
Return an instance of the service.
Return an instance of the service.
- T
the wrapped object type
- name
The name of the instance to retrieve.
- caller
An optional string to provide the origin of the function call for error messages.
- returns
The instance.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
has(name: String): Boolean
Allows the user to query if the particular service exists.
Allows the user to query if the particular service exists.
- name
Name of the service to query.
- returns
true if injector has given service.
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
instantiate[T <: Object](type: Function, locals: Object = js.native): T
Create a new instance of JS type.
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.
- locals
Optional object. If preset then any argument names are read from this object first, before the $injector is consulted.
- returns
new instance of Type.
-
def
invoke(fn: Function, self: Object = js.native, locals: Object = js.native): Any
Invoke the method and supply the method arguments from the $injector.
Invoke the method and supply the method arguments from the $injector.
- fn
The injectable function to invoke. Function parameters are injected according to the $inject Annotation rules.
- self
The this for the invoked method.
- locals
Optional object. If preset then any argument names are read from this object first, before the $injector is consulted.
- returns
the value returned by the invoked fn function.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )