码迷,mamicode.com
首页 > 其他好文 > 详细

angular 双向绑定

时间:2018-04-23 18:35:56      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:NPU   template   url   angular   style   mod   bind   div   pre   

<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‘;
  }


}

 

angular 双向绑定

标签:NPU   template   url   angular   style   mod   bind   div   pre   

原文地址:https://www.cnblogs.com/chenyishi/p/8920494.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!