Closed sdandroid closed 1 year ago
[https://stackz.com/edit/angular-If7hxd?file=src%2FAPPP.comPonent.ts] %2FAPP. Component.ts)
Choose the first select
The value of the subjectid2 in this.sf.value is empty
Still the previous value
ENVIRONMENT | Info |
---|---|
NG-ALAIN | 16.3.0 |
Browser | Chrome |
The value of this.SF.GetValue ('Subjectid2') is empty.
不管是 null
或 undefined
都是表示具体的值,像DEMO中可以:
- this.sf.setValue("/subjectId2", null)
+ this.sf.setValue("/subjectId2", this.i.subjectId2)
我想实现的逻辑是,select 选了特定的值后,清空 subjectId2 的值,提交的时候值为null | undefined
Reproduction link
https://stackblitz.com/edit/angular-if7hxd?file=src%2Fapp%2Fapp.component.ts
Steps to reproduce
选择个第一个select
What is expected?
this.sf.value 里面的subjectId2的值为空
What is actually happening?
还是之前的值
this.sf.getValue('subjectId2') 的值为空。