diff --git a/packages/examples/common/ngIf/ts/module.ts b/packages/examples/common/ngIf/ts/module.ts index 1473bd9254..fe2732d2ae 100644 --- a/packages/examples/common/ngIf/ts/module.ts +++ b/packages/examples/common/ngIf/ts/module.ts @@ -57,13 +57,13 @@ class NgIfElse { ` }) class NgIfThenElse implements OnInit { - thenBlock: TemplateRef = null; + thenBlock: TemplateRef|null = null; show: boolean = true; @ViewChild('primaryBlock') - primaryBlock: TemplateRef = null; + primaryBlock: TemplateRef|null = null; @ViewChild('secondaryBlock') - secondaryBlock: TemplateRef = null; + secondaryBlock: TemplateRef|null = null; switchPrimary() { this.thenBlock = this.thenBlock === this.primaryBlock ? this.secondaryBlock : this.primaryBlock; diff --git a/packages/examples/common/pipes/ts/async_pipe.ts b/packages/examples/common/pipes/ts/async_pipe.ts index 01a111b14c..5480cf6b6e 100644 --- a/packages/examples/common/pipes/ts/async_pipe.ts +++ b/packages/examples/common/pipes/ts/async_pipe.ts @@ -20,10 +20,10 @@ import {Subscriber} from 'rxjs/Subscriber'; ` }) export class AsyncPromisePipeComponent { - greeting: Promise = null; + greeting: Promise|null = null; arrived: boolean = false; - private resolve: Function = null; + private resolve: Function|null = null; constructor() { this.reset(); } @@ -36,7 +36,7 @@ export class AsyncPromisePipeComponent { if (this.arrived) { this.reset(); } else { - this.resolve('hi there!'); + this.resolve !('hi there!'); this.arrived = true; } } diff --git a/packages/examples/core/debug/ts/debug_element/debug_element.ts b/packages/examples/core/debug/ts/debug_element/debug_element.ts index 2b93836568..63cf722dc0 100644 --- a/packages/examples/core/debug/ts/debug_element/debug_element.ts +++ b/packages/examples/core/debug/ts/debug_element/debug_element.ts @@ -8,7 +8,7 @@ import {DebugElement} from '@angular/core'; -let debugElement: DebugElement; +let debugElement: DebugElement = undefined !; let predicate: any; // #docregion scope_all diff --git a/packages/examples/core/di/ts/metadata_spec.ts b/packages/examples/core/di/ts/metadata_spec.ts index 03ae810402..3d847206dc 100644 --- a/packages/examples/core/di/ts/metadata_spec.ts +++ b/packages/examples/core/di/ts/metadata_spec.ts @@ -171,7 +171,7 @@ export function main() { declarations: [App, ParentCmp, ChildDirective], }); - let cmp: ComponentFixture; + let cmp: ComponentFixture = undefined !; expect(() => cmp = TestBed.createComponent(App)).not.toThrow(); expect(cmp.debugElement.children[0].children[0].injector.get(ChildDirective).logs).toEqual([ diff --git a/packages/examples/platform-browser/dom/debug/ts/by/by.ts b/packages/examples/platform-browser/dom/debug/ts/by/by.ts index 19e64d6e62..70283ebda7 100644 --- a/packages/examples/platform-browser/dom/debug/ts/by/by.ts +++ b/packages/examples/platform-browser/dom/debug/ts/by/by.ts @@ -9,7 +9,7 @@ import {DebugElement} from '@angular/core'; import {By} from '@angular/platform-browser'; -let debugElement: DebugElement; +let debugElement: DebugElement = undefined !; class MyDirective {} // #docregion by_all diff --git a/packages/examples/tsconfig-build.json b/packages/examples/tsconfig-build.json index ff32a45e25..773c830149 100644 --- a/packages/examples/tsconfig-build.json +++ b/packages/examples/tsconfig-build.json @@ -5,6 +5,7 @@ "stripInternal": true, "experimentalDecorators": true, "noImplicitAny": true, + "strictNullChecks": true, "emitDecoratorMetadata": true, "module": "commonjs", "moduleResolution": "node",