ng-alain / ng-alain

NG-ZORRO admin panel front-end framework (surge mirror https://ng-alain-doc.surge.sh)
https://ng-alain.com
MIT License
4.54k stars 1.16k forks source link

this.sf.setValue('/subjectId2', null) this.sf.value 结果不对 #2428

Closed sdandroid closed 1 year ago

sdandroid commented 1 year ago

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?

还是之前的值

Environment Info
ng-alain 16.3.0
Browser chrome

this.sf.getValue('subjectId2') 的值为空。

alain-bot[bot] commented 1 year ago

Translation of this issue:

This.SF.SETVALUE ('/Subjectid2', NULL) this.sf.value result is wrong

REPRODUCTION LINK

[https://stackz.com/edit/angular-If7hxd?file=src%2FAPPP.comPonent.ts] %2FAPP. Component.ts)

STEPS To Reproduce

Choose the first select

What is exfected?

The value of the subjectid2 in this.sf.value is empty

What is actually happy?

Still the previous value

ENVIRONMENT Info
NG-ALAIN 16.3.0
Browser Chrome

The value of this.SF.GetValue ('Subjectid2') is empty.

cipchk commented 1 year ago

不管是 nullundefined 都是表示具体的值,像DEMO中可以:

- this.sf.setValue("/subjectId2", null)
+ this.sf.setValue("/subjectId2", this.i.subjectId2)
sdandroid commented 1 year ago

我想实现的逻辑是,select 选了特定的值后,清空 subjectId2 的值,提交的时候值为null | undefined