fix(router): Update types for TypeScript nullability support

This commit is contained in:
Miško Hevery
2017-03-24 09:55:52 -07:00
committed by Tobias Bosch
parent c36ec9bf60
commit 56c46d70f7
26 changed files with 230 additions and 223 deletions

View File

@ -16,7 +16,7 @@ import {NavigationEnd, Resolve, Router, RouterModule} from '@angular/router';
describe('bootstrap', () => {
let log: any[] = [];
let testProviders: any[] = null;
let testProviders: any[] = null !;
@Component({selector: 'test-app', template: 'root <router-outlet></router-outlet>'})
class RootCmp {
@ -80,7 +80,7 @@ describe('bootstrap', () => {
platformBrowserDynamic([]).bootstrapModule(TestModule).then(res => {
const router = res.injector.get(Router);
const data = router.routerState.snapshot.root.firstChild.data;
const data = router.routerState.snapshot.root.firstChild !.data;
expect(data['test']).toEqual('test-data');
expect(log).toEqual(
['TestModule', 'NavigationStart', 'RoutesRecognized', 'RootCmp', 'NavigationEnd']);