标签:pre name scribe sage text vat mod class span
// 如果使用表单 loopholeForm: FormGroup; constructor( fb: FormBuilder, private modalRef: NzModalRef, private message: NzMessageService, private cveService: CveService ) { this.loopholeForm = fb.group({ loophole: [null], cveName: [null], cnnvdName: [null], grade: [null] }); } ngOnInit() { // 监听整个表单的变化 this.loopholeForm.valueChanges.subscribe(data => console.log(‘form‘, data)); // 单个control 变化 this.loopholeForm.get(‘cveName‘).valueChanges.subscribe(data => console.log(‘solo‘, data)); }
<nz-form-item> <nz-form-label nzRequired>CNNVD编号</nz-form-label> <nz-form-control nzErrorTip="cnnvd编号不能为空"> <input type="text" nz-input nzSize="default" formControlName="cnnvdName" // 这里绑定 autocomplete="off" placeholder="CNNVD编号" maxlength="255" /> </nz-form-control> </nz-form-item>
标签:pre name scribe sage text vat mod class span
原文地址:https://www.cnblogs.com/gushiyoyo/p/12091549.html