export class HostMetadata
export class HostMetadata
exported from angular2/core defined in angular2/src/core/di/metadata.ts (line 180)
Specifies that an injector should retrieve a dependency from any injector until reaching the closest host.
In Angular, a component element is automatically declared as a host for all the injectors in its view.
Example (live demo)
In the following example App
contains ParentCmp
, which contains ChildDirective
.
So ParentCmp
is the host of ChildDirective
.
ChildDirective
depends on two services: HostService
and OtherService
.
HostService
is defined at ParentCmp
, and OtherService
is defined at App
.
Members
toString() : string
toString() : string
Not Yet Documented