From eb6ff65af7359f37a98237a04f70159ee4293e14 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Wed, 20 Jul 2016 14:47:51 -0700 Subject: [PATCH] refactor(router): makes an error message clearer --- modules/@angular/router/src/config.ts | 2 +- modules/@angular/router/test/config.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/@angular/router/src/config.ts b/modules/@angular/router/src/config.ts index 544bc95ff9..c2e48df9f9 100644 --- a/modules/@angular/router/src/config.ts +++ b/modules/@angular/router/src/config.ts @@ -525,7 +525,7 @@ function validateNode(route: Route): void { if (route.redirectTo === undefined && !route.component && !route.children && !route.loadChildren) { throw new Error( - `Invalid configuration of route '${route.path}': component, redirectTo, children, loadChildren must be provided`); + `Invalid configuration of route '${route.path}': one of the following must be provided (component or redirectTo or children or loadChildren)`); } if (route.path === undefined) { throw new Error(`Invalid route configuration: routes must have path specified`); diff --git a/modules/@angular/router/test/config.spec.ts b/modules/@angular/router/test/config.spec.ts index c85377a0f9..36c8378c0b 100644 --- a/modules/@angular/router/test/config.spec.ts +++ b/modules/@angular/router/test/config.spec.ts @@ -51,7 +51,7 @@ describe('config', () => { it('should throw when none of component and children or direct are missing', () => { expect(() => { validateConfig([{path: 'a'}]); }) .toThrowError( - `Invalid configuration of route 'a': component, redirectTo, children, loadChildren must be provided`); + `Invalid configuration of route 'a': one of the following must be provided (component or redirectTo or children or loadChildren)`); }); it('should throw when path starts with a slash', () => {