update docshredder to shred .es6 optimized focus gulp task convert imports and metadate sections add DI section add host and query metadata section add intro fix capitalization and grammar
33 lines
684 B
JavaScript
33 lines
684 B
JavaScript
import { Component, Inject, NgModule } from '@angular/core';
|
|
import { BrowserModule } from '@angular/platform-browser';
|
|
|
|
// #docregion
|
|
class HeroComponent {
|
|
constructor(name) {
|
|
this.name = name;
|
|
}
|
|
}
|
|
|
|
HeroComponent.annotations = [
|
|
new Component({
|
|
selector: 'hero-di-inject',
|
|
template: `<h1>Hero: {{name}}</h1>`
|
|
})
|
|
];
|
|
|
|
HeroComponent.parameters = [
|
|
[new Inject('heroName')]
|
|
];
|
|
// #enddocregion
|
|
|
|
export class HeroesDIInjectModule { }
|
|
|
|
HeroesDIInjectModule.annotations = [
|
|
new NgModule({
|
|
imports: [ BrowserModule ],
|
|
providers: [ { provide: 'heroName', useValue: 'Windstorm' } ],
|
|
declarations: [ HeroComponent ],
|
|
bootstrap: [ HeroComponent ]
|
|
})
|
|
];
|