angular-cn/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject.component.ts
2016-11-14 09:08:54 -08:00

12 lines
258 B
TypeScript

import { Component, Inject } from '@angular/core';
// #docregion
@Component({
selector: 'hero-di-inject',
template: `<h1>Hero: {{name}}</h1>`
})
export class HeroComponent {
constructor(@Inject('heroName') private name: string) { }
}
// #enddocregion