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:
Rado Kirov
2018-06-18 16:38:33 -07:00
committed by Miško Hevery
parent 39c7769c9e
commit c95437f15d
189 changed files with 1273 additions and 632 deletions

View File

@ -79,8 +79,10 @@ export const CHECKBOX_REQUIRED_VALIDATOR: StaticProvider = {
host: {'[attr.required]': 'required ? "" : null'}
})
export class RequiredValidator implements Validator {
private _required: boolean;
private _onChange: () => void;
// TODO(issue/24571): remove '!'.
private _required !: boolean;
// TODO(issue/24571): remove '!'.
private _onChange !: () => void;
@Input()
get required(): boolean|string { return this._required; }
@ -150,8 +152,10 @@ export const EMAIL_VALIDATOR: any = {
providers: [EMAIL_VALIDATOR]
})
export class EmailValidator implements Validator {
private _enabled: boolean;
private _onChange: () => void;
// TODO(issue/24571): remove '!'.
private _enabled !: boolean;
// TODO(issue/24571): remove '!'.
private _onChange !: () => void;
@Input()
set email(value: boolean|string) {
@ -198,10 +202,13 @@ export const MIN_LENGTH_VALIDATOR: any = {
})
export class MinLengthValidator implements Validator,
OnChanges {
private _validator: ValidatorFn;
private _onChange: () => void;
// TODO(issue/24571): remove '!'.
private _validator !: ValidatorFn;
// TODO(issue/24571): remove '!'.
private _onChange !: () => void;
@Input() minlength: string;
// TODO(issue/24571): remove '!'.
@Input() minlength !: string;
ngOnChanges(changes: SimpleChanges): void {
if ('minlength' in changes) {
@ -248,10 +255,13 @@ export const MAX_LENGTH_VALIDATOR: any = {
})
export class MaxLengthValidator implements Validator,
OnChanges {
private _validator: ValidatorFn;
private _onChange: () => void;
// TODO(issue/24571): remove '!'.
private _validator !: ValidatorFn;
// TODO(issue/24571): remove '!'.
private _onChange !: () => void;
@Input() maxlength: string;
// TODO(issue/24571): remove '!'.
@Input() maxlength !: string;
ngOnChanges(changes: SimpleChanges): void {
if ('maxlength' in changes) {
@ -299,10 +309,13 @@ export const PATTERN_VALIDATOR: any = {
})
export class PatternValidator implements Validator,
OnChanges {
private _validator: ValidatorFn;
private _onChange: () => void;
// TODO(issue/24571): remove '!'.
private _validator !: ValidatorFn;
// TODO(issue/24571): remove '!'.
private _onChange !: () => void;
@Input() pattern: string|RegExp;
// TODO(issue/24571): remove '!'.
@Input() pattern !: string | RegExp;
ngOnChanges(changes: SimpleChanges): void {
if ('pattern' in changes) {