Home Reference Source Repository
public class | since 0.0.1 | source

$Injector

You can directly use instance of this class. $Injector

Handles dependency injection, will return one or many arguments passed as a string or an array.

Example:

$Injector.get('test');

Static Method Summary

Static Public Methods
public static

Responsible for routing of dependencies

since 0.0.1

Static Public Methods

public static get(The: object | string): object | string | number | Array<> | boolean since 0.0.1 source

Responsible for routing of dependencies

Params:

NameTypeAttributeDescription
The object | string

name or array of names of providers to fetch

Return:

object | string | number | Array<> | boolean

The provider value

Example:

$Injector.get('$scope'); // = { $id: 1 }

TODO:

  • Replace `Array.prototype.slice.call` with `Array.from` when it is supported without the polyfill