angular 双向绑定
<input type="text" [(ngModel)]="name"> {{name}}
import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-bind', templateUrl: './bind.component.html', styleUrls: ['./bind.component.css'] }) export class BindComponent implements OnInit { private name; constructor() { } ngOnInit() { this.name = 'cys'; } }
- 上一篇 »vue.js和angular双向数据绑定的实现原理
- 下一篇 »vue实现组件数据双向绑定