build(bazel): Turning on strictPropertyInitialization for Angular. (#24572)
All errors for existing fields have been detected and suppressed with a `!` assertion. Issue/24571 is tracking proper clean up of those instances. One-line change required in ivy/compilation.ts, because it appears that the new syntax causes tsickle emitted node to no longer track their original sourceFiles. PR Close #24572
This commit is contained in:
@ -2467,7 +2467,8 @@ function sortedClassList(el: HTMLElement) {
|
||||
|
||||
@Component({selector: 'form-control-comp', template: `<input type="text" [formControl]="control">`})
|
||||
class FormControlComp {
|
||||
control: FormControl;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
control !: FormControl;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -2478,9 +2479,12 @@ class FormControlComp {
|
||||
</form>`
|
||||
})
|
||||
class FormGroupComp {
|
||||
control: FormControl;
|
||||
form: FormGroup;
|
||||
event: Event;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
control !: FormControl;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
form !: FormGroup;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
event !: Event;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -2495,7 +2499,8 @@ class FormGroupComp {
|
||||
</form>`
|
||||
})
|
||||
class NestedFormGroupComp {
|
||||
form: FormGroup;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
form !: FormGroup;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -2510,8 +2515,10 @@ class NestedFormGroupComp {
|
||||
</form>`
|
||||
})
|
||||
class FormArrayComp {
|
||||
form: FormGroup;
|
||||
cityArray: FormArray;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
form !: FormGroup;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
cityArray !: FormArray;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -2527,8 +2534,10 @@ class FormArrayComp {
|
||||
</div>`
|
||||
})
|
||||
class FormArrayNestedGroup {
|
||||
form: FormGroup;
|
||||
cityArray: FormArray;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
form !: FormGroup;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
cityArray !: FormArray;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -2540,9 +2549,12 @@ class FormArrayNestedGroup {
|
||||
</form>`
|
||||
})
|
||||
class FormGroupNgModel {
|
||||
form: FormGroup;
|
||||
login: string;
|
||||
password: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
form !: FormGroup;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
login !: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
password !: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -2553,10 +2565,14 @@ class FormGroupNgModel {
|
||||
`
|
||||
})
|
||||
class FormControlNgModel {
|
||||
control: FormControl;
|
||||
login: string;
|
||||
passwordControl: FormControl;
|
||||
password: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
control !: FormControl;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
login !: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
passwordControl !: FormControl;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
password !: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -2570,7 +2586,8 @@ class FormControlNgModel {
|
||||
</div>`
|
||||
})
|
||||
class LoginIsEmptyWrapper {
|
||||
form: FormGroup;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
form !: FormGroup;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -2584,11 +2601,16 @@ class LoginIsEmptyWrapper {
|
||||
</div>`
|
||||
})
|
||||
class ValidationBindingsForm {
|
||||
form: FormGroup;
|
||||
required: boolean;
|
||||
minLen: number;
|
||||
maxLen: number;
|
||||
pattern: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
form !: FormGroup;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
required !: boolean;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
minLen !: number;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
maxLen !: number;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
pattern !: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -2596,7 +2618,8 @@ class ValidationBindingsForm {
|
||||
template: `<input type="checkbox" [formControl]="control">`
|
||||
})
|
||||
class FormControlCheckboxRequiredValidator {
|
||||
control: FormControl;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
control !: FormControl;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -2607,5 +2630,6 @@ class FormControlCheckboxRequiredValidator {
|
||||
</div>`
|
||||
})
|
||||
class UniqLoginWrapper {
|
||||
form: FormGroup;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
form !: FormGroup;
|
||||
}
|
||||
|
@ -1640,7 +1640,8 @@ import {NgModelCustomComp, NgModelCustomWrapper} from './value_accessor_integrat
|
||||
`
|
||||
})
|
||||
class StandaloneNgModel {
|
||||
name: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
name !: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -1652,8 +1653,10 @@ class StandaloneNgModel {
|
||||
`
|
||||
})
|
||||
class NgModelForm {
|
||||
name: string;
|
||||
event: Event;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
name !: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
event !: Event;
|
||||
options = {};
|
||||
|
||||
onReset() {}
|
||||
@ -1676,10 +1679,14 @@ class NgModelNativeValidateForm {
|
||||
`
|
||||
})
|
||||
class NgModelGroupForm {
|
||||
first: string;
|
||||
last: string;
|
||||
email: string;
|
||||
isDisabled: boolean;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
first !: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
last !: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
email !: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
isDisabled !: boolean;
|
||||
options = {updateOn: 'change'};
|
||||
}
|
||||
|
||||
@ -1695,7 +1702,8 @@ class NgModelGroupForm {
|
||||
`
|
||||
})
|
||||
class NgModelValidBinding {
|
||||
first: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
first !: string;
|
||||
}
|
||||
|
||||
|
||||
@ -1711,10 +1719,12 @@ class NgModelValidBinding {
|
||||
`
|
||||
})
|
||||
class NgModelNgIfForm {
|
||||
first: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
first !: string;
|
||||
groupShowing = true;
|
||||
emailShowing = true;
|
||||
email: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
email !: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -1749,8 +1759,10 @@ class InvalidNgModelNoName {
|
||||
`
|
||||
})
|
||||
class NgModelOptionsStandalone {
|
||||
one: string;
|
||||
two: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
one !: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
two !: string;
|
||||
options: {name?: string, standalone?: boolean, updateOn?: string} = {standalone: true};
|
||||
formOptions = {};
|
||||
}
|
||||
@ -1767,10 +1779,14 @@ class NgModelOptionsStandalone {
|
||||
`
|
||||
})
|
||||
class NgModelValidationBindings {
|
||||
required: boolean;
|
||||
minLen: number;
|
||||
maxLen: number;
|
||||
pattern: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
required !: boolean;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
minLen !: number;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
maxLen !: number;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
pattern !: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -1782,9 +1798,12 @@ class NgModelValidationBindings {
|
||||
`
|
||||
})
|
||||
class NgModelMultipleValidators {
|
||||
required: boolean;
|
||||
minLen: number;
|
||||
pattern: string|RegExp;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
required !: boolean;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
minLen !: number;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
pattern !: string | RegExp;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -1832,7 +1851,8 @@ class NgModelAsyncValidation {
|
||||
`
|
||||
})
|
||||
class NgModelChangesForm {
|
||||
name: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
name !: string;
|
||||
events: string[] = [];
|
||||
options: any;
|
||||
|
||||
|
@ -1088,7 +1088,8 @@ import {dispatchEvent} from '@angular/platform-browser/testing/src/browser_util'
|
||||
|
||||
@Component({selector: 'form-control-comp', template: `<input type="text" [formControl]="control">`})
|
||||
export class FormControlComp {
|
||||
control: FormControl;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
control !: FormControl;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -1099,10 +1100,14 @@ export class FormControlComp {
|
||||
</form>`
|
||||
})
|
||||
export class FormGroupComp {
|
||||
control: FormControl;
|
||||
form: FormGroup;
|
||||
myGroup: FormGroup;
|
||||
event: Event;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
control !: FormControl;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
form !: FormGroup;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
myGroup !: FormGroup;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
event !: Event;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -1110,7 +1115,8 @@ export class FormGroupComp {
|
||||
template: `<input type="number" [formControl]="control">`
|
||||
})
|
||||
class FormControlNumberInput {
|
||||
control: FormControl;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
control !: FormControl;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -1269,7 +1275,8 @@ class NgModelSelectMultipleWithCustomCompareFnForm {
|
||||
`
|
||||
})
|
||||
class NgModelSelectMultipleForm {
|
||||
selectedCities: any[];
|
||||
// TODO(issue/24571): remove '!'.
|
||||
selectedCities !: any[];
|
||||
cities: any[] = [];
|
||||
}
|
||||
|
||||
@ -1278,7 +1285,8 @@ class NgModelSelectMultipleForm {
|
||||
template: `<input type="range" [formControl]="control">`
|
||||
})
|
||||
class FormControlRangeInput {
|
||||
control: FormControl;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
control !: FormControl;
|
||||
}
|
||||
|
||||
@Component({selector: 'ng-model-range-form', template: '<input type="range" [(ngModel)]="val">'})
|
||||
@ -1299,7 +1307,8 @@ class NgModelRangeForm {
|
||||
<input type="radio" [formControl]="showRadio" value="no">`
|
||||
})
|
||||
export class FormControlRadioButtons {
|
||||
form: FormGroup;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
form !: FormGroup;
|
||||
showRadio = new FormControl('yes');
|
||||
}
|
||||
|
||||
@ -1316,8 +1325,10 @@ export class FormControlRadioButtons {
|
||||
`
|
||||
})
|
||||
class NgModelRadioForm {
|
||||
food: string;
|
||||
drink: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
food !: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
drink !: string;
|
||||
}
|
||||
|
||||
@Directive({
|
||||
@ -1330,7 +1341,8 @@ class NgModelRadioForm {
|
||||
})
|
||||
class WrappedValue implements ControlValueAccessor {
|
||||
value: any;
|
||||
onChange: Function;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
onChange !: Function;
|
||||
|
||||
writeValue(value: any) { this.value = `!${value}!`; }
|
||||
|
||||
@ -1345,7 +1357,8 @@ class WrappedValue implements ControlValueAccessor {
|
||||
@Component({selector: 'my-input', template: ''})
|
||||
export class MyInput implements ControlValueAccessor {
|
||||
@Output('input') onInput = new EventEmitter();
|
||||
value: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
value !: string;
|
||||
|
||||
constructor(cd: NgControl) { cd.valueAccessor = this; }
|
||||
|
||||
@ -1366,7 +1379,8 @@ export class MyInput implements ControlValueAccessor {
|
||||
</div>`
|
||||
})
|
||||
export class MyInputForm {
|
||||
form: FormGroup;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
form !: FormGroup;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -1377,7 +1391,8 @@ export class MyInputForm {
|
||||
</div>`
|
||||
})
|
||||
class WrappedValueForm {
|
||||
form: FormGroup;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
form !: FormGroup;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -1388,9 +1403,11 @@ class WrappedValueForm {
|
||||
providers: [{provide: NG_VALUE_ACCESSOR, multi: true, useExisting: NgModelCustomComp}]
|
||||
})
|
||||
export class NgModelCustomComp implements ControlValueAccessor {
|
||||
model: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
model !: string;
|
||||
@Input('disabled') isDisabled: boolean = false;
|
||||
changeFn: (value: any) => void;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
changeFn !: (value: any) => void;
|
||||
|
||||
writeValue(value: any) { this.model = value; }
|
||||
|
||||
@ -1410,6 +1427,7 @@ export class NgModelCustomComp implements ControlValueAccessor {
|
||||
`
|
||||
})
|
||||
export class NgModelCustomWrapper {
|
||||
name: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
name !: string;
|
||||
isDisabled = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user