Angular sampleメモ

アクション

src/app/app.component.ts

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'yohei';
  sayHello() {
    // alert("hello")
    this.title = 'hello!';
  }
}

src/app/app.component.html

<button type="button" name="button" (click)="sayHello()">sayHello