Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9f76fb6

Browse files
arturovtthePunderWoman
authored andcommitted
refactor(forms): tree-shakengControlStatusHost andngGroupStatusHost
This commit removes `ngGroupStatusHost` variable because it's a side-effect, ending up preserving `ngControlStatusHost` and `ngGroupStatusHost`.
1 parent4441437 commit9f76fb6

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

‎packages/core/test/bundling/forms_reactive/bundle.golden_symbols.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,8 +814,6 @@
814814
"nextBindingIndex",
815815
"nextNgElementId",
816816
"nextNotification",
817-
"ngControlStatusHost",
818-
"ngGroupStatusHost",
819817
"ngOnChangesSetInput",
820818
"ngZoneInstanceId",
821819
"noSideEffects",

‎packages/core/test/bundling/forms_template_driven/bundle.golden_symbols.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,8 +813,6 @@
813813
"nextContextImpl",
814814
"nextNgElementId",
815815
"nextNotification",
816-
"ngControlStatusHost",
817-
"ngGroupStatusHost",
818816
"ngOnChangesSetInput",
819817
"ngZoneInstanceId",
820818
"noSideEffects",

‎packages/forms/src/directives/ng_control_status.ts‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ export const ngControlStatusHost = {
8181
'[class.ng-pending]':'isPending',
8282
};
8383

84-
exportconstngGroupStatusHost={
85-
...ngControlStatusHost,
86-
'[class.ng-submitted]':'isSubmitted',
87-
};
88-
8984
/**
9085
*@description
9186
* Directive automatically applied to Angular form controls that sets CSS classes
@@ -135,7 +130,13 @@ export class NgControlStatus extends AbstractControlStatus {
135130
@Directive({
136131
selector:
137132
'[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]',
138-
host:ngGroupStatusHost,
133+
// Note: having this object here to ensure that the spread assignment is not considered
134+
// a side-effect, ending up preserving `ngControlStatusHost` and `ngGroupStatusHost`.
135+
// Do not move it to a separate const (`ngGroupStatusHost`).
136+
host:{
137+
...ngControlStatusHost,
138+
'[class.ng-submitted]':'isSubmitted',
139+
},
139140
standalone:false,
140141
})
141142
exportclassNgControlStatusGroupextendsAbstractControlStatus{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp