1. <div *ngFor="let item of lists">
    2. {{item}}
    3. </div>
    1. import { Component } from '@angular/core';
    2. @Component({
    3. selector: 'app-root',
    4. templateUrl: './app.component.html',
    5. styleUrls: ['./app.component.css']
    6. })
    7. export class AppComponent {
    8. title = 'my-app';
    9. lists:Array<number> = [1,2,3];
    10. handleClick():void{
    11. console.log(this.title)
    12. this.title = "change"
    13. }
    14. }