This repository was archived by the owner on Jul 22, 2020. It is now read-only.
[WIP]fix: no-op when patchValue receive undefined#26
Open
wjw99830 wants to merge 3 commits intozent-contrib:masterfrom
Open
[WIP]fix: no-op when patchValue receive undefined#26wjw99830 wants to merge 3 commits intozent-contrib:masterfrom
wjw99830 wants to merge 3 commits intozent-contrib:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
调用父级字段(
Set、Array、Form)的patchValue时,由于参数是Partial的,因此各个Field有可能会接收到undefined,但是内部调用的patchValue躲过了类型检查,因此这里会出现类型不正确的情况。体现在业务中就是调用
form.patchValue时某个field值由于某种原因为undefined,此处不会提示类型错误,但访问fieldModel.value时出现了预期之外的undefined。