2019-09-12 15:20:54 -07:00
|
|
|
/**
|
|
|
|
* @license
|
2020-05-19 12:08:49 -07:00
|
|
|
* Copyright Google LLC All Rights Reserved.
|
2019-09-12 15:20:54 -07:00
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
|
|
|
import {Component} from '@angular/core';
|
|
|
|
|
2019-09-19 17:04:02 -07:00
|
|
|
export interface Hero {
|
2019-09-12 15:20:54 -07:00
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'my-app',
|
2020-06-05 22:42:35 -07:00
|
|
|
template: `
|
|
|
|
<h1>{{title}}</h1>
|
|
|
|
<h2>{{hero.name}} details!</h2>
|
2019-09-12 15:20:54 -07:00
|
|
|
`
|
|
|
|
})
|
|
|
|
export class AppComponent {
|
|
|
|
title = 'Tour of Heroes';
|
|
|
|
hero: Hero = {id: 1, name: 'Windstorm'};
|
2019-09-19 17:04:02 -07:00
|
|
|
private internal: string = 'internal';
|
2020-06-04 06:35:30 -07:00
|
|
|
setTitle(newTitle: string) {
|
|
|
|
this.title = newTitle;
|
|
|
|
}
|
2019-09-12 15:20:54 -07:00
|
|
|
}
|