Angular Reactive Form里的setNgReflectProperty
生活随笔
收集整理的這篇文章主要介紹了
Angular Reactive Form里的setNgReflectProperty
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
源代碼:
import { Component } from '@angular/core'; import { FormControl } from '@angular/forms';@Component({selector: 'app-reactive-favorite-color',template: `Favorite Color: <input type="text" [formControl]="favoriteColorControl">` }) export class ReactFormComponent {favoriteColorControl = new FormControl(''); }ctrl單擊formControl:找到其實現位置:
form需要綁定一個FormControl實例進去,如下圖所示:
setNgReflectProperty函數里的代碼:
value就是favoriteColorControl:
更多Jerry的原創文章,盡在:“汪子熙”:
總結
以上是生活随笔為你收集整理的Angular Reactive Form里的setNgReflectProperty的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SAP Spartacus user r
- 下一篇: 教你搭建一套自己的SVN服务器