mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
3ed7463ad7
PR Close #30845
20 lines
361 B
TypeScript
20 lines
361 B
TypeScript
import { Component } from '@angular/core';
|
|
|
|
@Component({
|
|
selector: 'app-root',
|
|
template: `
|
|
<h1>{{title}} [Ctor version]</h1>
|
|
<h2>My favorite hero is: {{myHero}}</h2>
|
|
`
|
|
})
|
|
// #docregion class
|
|
export class AppComponent {
|
|
title: string;
|
|
myHero: string;
|
|
|
|
constructor() {
|
|
this.title = 'Tour of Heroes';
|
|
this.myHero = 'Windstorm';
|
|
}
|
|
}
|