angular-cn/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject.component.ts

12 lines
258 B
TypeScript
Raw Normal View History

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