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

23 lines
496 B
TypeScript

import { Attribute, Component, Inject, Optional } from '@angular/core';
// #docregion
// #docregion templateUrl
@Component({
moduleId: module.id,
selector: 'hero-title',
templateUrl: 'hero-title.component.html'
})
// #enddocregion templateUrl
export class HeroTitleComponent {
msg: string = '';
constructor(
@Inject('titlePrefix') @Optional() private titlePrefix: string,
@Attribute('title') private title: string
) { }
ok() {
this.msg = 'OK!';
}
}
// #enddocregion