双向绑定

    科技2025-12-20  8

    <h3>双向绑定</h3> <input [(ngModel)]="name"> {{name}}

    TS:

    public name = 'Jonny' ; constructor() { setTimeout(() => { this.divClass = 'a b c'; this.isBig = true; this.divClassABC = { a: true, b: true, c: false }; }, 3000); setInterval(() => { this.name = 'Jenny'; }, 3000); }

     

    Processed: 0.032, SQL: 9