Content-Length: 384904 | pFad | https://github.com/angular/angular/commit/bdd5e204233eeb79e04a782a51c08429991eb03e

4D fix(forms): resolve host binding type issues (#60481) · angular/angular@bdd5e20 · GitHub
Skip to content

Commit bdd5e20

Browse files
crisbetoalxhub
authored andcommitted
fix(forms): resolve host binding type issues (#60481)
Fixes some type issues that are being flagged now that we have type checking of host bindings. PR Close #60481
1 parent 785a111 commit bdd5e20

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

packages/forms/src/directives/checkbox_value_accessor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const CHECKBOX_VALUE_ACCESSOR: Provider = {
4646
@Directive({
4747
selector:
4848
'input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]',
49-
host: {'(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()'},
49+
host: {'(change)': 'onChange($any($event.target).checked)', '(blur)': 'onTouched()'},
5050
providers: [CHECKBOX_VALUE_ACCESSOR],
5151
standalone: false,
5252
})

packages/forms/src/directives/default_value_accessor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ export const COMPOSITION_BUFFER_MODE = new InjectionToken<boolean>(
9090
// https://github.com/angular/angular/issues/3011 is implemented
9191
// selector: '[ngModel],[formControl],[formControlName]',
9292
host: {
93-
'(input)': '$any(this)._handleInput($event.target.value)',
93+
'(input)': '_handleInput($any($event.target).value)',
9494
'(blur)': 'onTouched()',
95-
'(compositionstart)': '$any(this)._compositionStart()',
96-
'(compositionend)': '$any(this)._compositionEnd($event.target.value)',
95+
'(compositionstart)': '_compositionStart()',
96+
'(compositionend)': '_compositionEnd($any($event.target).value)',
9797
},
9898
providers: [DEFAULT_VALUE_ACCESSOR],
9999
standalone: false,

packages/forms/src/directives/number_value_accessor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const NUMBER_VALUE_ACCESSOR: Provider = {
4747
@Directive({
4848
selector:
4949
'input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]',
50-
host: {'(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()'},
50+
host: {'(input)': 'onChange($any($event.target).value)', '(blur)': 'onTouched()'},
5151
providers: [NUMBER_VALUE_ACCESSOR],
5252
standalone: false,
5353
})

packages/forms/src/directives/range_value_accessor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ const RANGE_VALUE_ACCESSOR: Provider = {
4848
selector:
4949
'input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]',
5050
host: {
51-
'(change)': 'onChange($event.target.value)',
52-
'(input)': 'onChange($event.target.value)',
51+
'(change)': 'onChange($any($event.target).value)',
52+
'(input)': 'onChange($any($event.target).value)',
5353
'(blur)': 'onTouched()',
5454
},
5555
providers: [RANGE_VALUE_ACCESSOR],

packages/forms/src/directives/select_control_value_accessor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function _extractId(valueString: string): string {
102102
@Directive({
103103
selector:
104104
'select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]',
105-
host: {'(change)': 'onChange($event.target.value)', '(blur)': 'onTouched()'},
105+
host: {'(change)': 'onChange($any($event.target).value)', '(blur)': 'onTouched()'},
106106
providers: [SELECT_VALUE_ACCESSOR],
107107
standalone: false,
108108
})

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/angular/angular/commit/bdd5e204233eeb79e04a782a51c08429991eb03e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy