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:
@ -38,10 +38,13 @@ import {Directive, DoCheck, ElementRef, Input, IterableChanges, IterableDiffer,
|
||||
*/
|
||||
@Directive({selector: '[ngClass]'})
|
||||
export class NgClass implements DoCheck {
|
||||
private _iterableDiffer: IterableDiffer<string>|null;
|
||||
private _keyValueDiffer: KeyValueDiffer<string, any>|null;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
private _iterableDiffer !: IterableDiffer<string>| null;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
private _keyValueDiffer !: KeyValueDiffer<string, any>| null;
|
||||
private _initialClasses: string[] = [];
|
||||
private _rawClass: string[]|Set<string>|{[klass: string]: any};
|
||||
// TODO(issue/24571): remove '!'.
|
||||
private _rawClass !: string[] | Set<string>| {[klass: string]: any};
|
||||
|
||||
constructor(
|
||||
private _iterableDiffers: IterableDiffers, private _keyValueDiffers: KeyValueDiffers,
|
||||
|
@ -66,10 +66,14 @@ import {ComponentFactoryResolver, ComponentRef, Directive, Injector, Input, NgMo
|
||||
*/
|
||||
@Directive({selector: '[ngComponentOutlet]'})
|
||||
export class NgComponentOutlet implements OnChanges, OnDestroy {
|
||||
@Input() ngComponentOutlet: Type<any>;
|
||||
@Input() ngComponentOutletInjector: Injector;
|
||||
@Input() ngComponentOutletContent: any[][];
|
||||
@Input() ngComponentOutletNgModuleFactory: NgModuleFactory<any>;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
@Input() ngComponentOutlet !: Type<any>;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
@Input() ngComponentOutletInjector !: Injector;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
@Input() ngComponentOutletContent !: any[][];
|
||||
// TODO(issue/24571): remove '!'.
|
||||
@Input() ngComponentOutletNgModuleFactory !: NgModuleFactory<any>;
|
||||
|
||||
private _componentRef: ComponentRef<any>|null = null;
|
||||
private _moduleRef: NgModuleRef<any>|null = null;
|
||||
|
@ -114,10 +114,12 @@ export class NgForOf<T> implements DoCheck {
|
||||
|
||||
get ngForTrackBy(): TrackByFunction<T> { return this._trackByFn; }
|
||||
|
||||
private _ngForOf: NgIterable<T>;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
private _ngForOf !: NgIterable<T>;
|
||||
private _ngForOfDirty: boolean = true;
|
||||
private _differ: IterableDiffer<T>|null = null;
|
||||
private _trackByFn: TrackByFunction<T>;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
private _trackByFn !: TrackByFunction<T>;
|
||||
|
||||
constructor(
|
||||
private _viewContainer: ViewContainerRef, private _template: TemplateRef<NgForOfContext<T>>,
|
||||
|
@ -46,8 +46,10 @@ import {SwitchView} from './ng_switch';
|
||||
*/
|
||||
@Directive({selector: '[ngPlural]'})
|
||||
export class NgPlural {
|
||||
private _switchValue: number;
|
||||
private _activeView: SwitchView;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
private _switchValue !: number;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
private _activeView !: SwitchView;
|
||||
private _caseViews: {[k: string]: SwitchView} = {};
|
||||
|
||||
constructor(private _localization: NgLocalization) {}
|
||||
|
@ -32,8 +32,10 @@ import {Directive, DoCheck, ElementRef, Input, KeyValueChanges, KeyValueDiffer,
|
||||
*/
|
||||
@Directive({selector: '[ngStyle]'})
|
||||
export class NgStyle implements DoCheck {
|
||||
private _ngStyle: {[key: string]: string};
|
||||
private _differ: KeyValueDiffer<string, string|number>;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
private _ngStyle !: {[key: string]: string};
|
||||
// TODO(issue/24571): remove '!'.
|
||||
private _differ !: KeyValueDiffer<string, string|number>;
|
||||
|
||||
constructor(
|
||||
private _differs: KeyValueDiffers, private _ngEl: ElementRef, private _renderer: Renderer2) {}
|
||||
|
@ -75,7 +75,8 @@ export class SwitchView {
|
||||
*/
|
||||
@Directive({selector: '[ngSwitch]'})
|
||||
export class NgSwitch {
|
||||
private _defaultViews: SwitchView[];
|
||||
// TODO(issue/24571): remove '!'.
|
||||
private _defaultViews !: SwitchView[];
|
||||
private _defaultUsed = false;
|
||||
private _caseCount = 0;
|
||||
private _lastCaseCheckIndex = 0;
|
||||
|
@ -34,11 +34,14 @@ import {Directive, EmbeddedViewRef, Input, OnChanges, SimpleChange, SimpleChange
|
||||
*/
|
||||
@Directive({selector: '[ngTemplateOutlet]'})
|
||||
export class NgTemplateOutlet implements OnChanges {
|
||||
private _viewRef: EmbeddedViewRef<any>;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
private _viewRef !: EmbeddedViewRef<any>;
|
||||
|
||||
@Input() public ngTemplateOutletContext: Object;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
@Input() public ngTemplateOutletContext !: Object;
|
||||
|
||||
@Input() public ngTemplateOutlet: TemplateRef<any>;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
@Input() public ngTemplateOutlet !: TemplateRef<any>;
|
||||
|
||||
constructor(private _viewContainerRef: ViewContainerRef) {}
|
||||
|
||||
|
Reference in New Issue
Block a user