refactor(router): move assertComponentExists into facade

This is to make way for a refactor to the ng 1.x router directives,
which will use strings rather than controller functions in route configs.
This commit is contained in:
Brian Ford
2015-09-18 15:41:02 -07:00
parent a443ea64a1
commit 43f97a951c
3 changed files with 15 additions and 8 deletions

View File

@ -31,7 +31,7 @@ import {
} from './route_config_impl';
import {reflector} from 'angular2/src/core/reflection/reflection';
import {Injectable} from 'angular2/src/core/di';
import {normalizeRouteConfig} from './route_config_nomalizer';
import {normalizeRouteConfig, assertComponentExists} from './route_config_nomalizer';
import {parser, Url, pathSegmentsToUrl} from './url_parser';
var _resolveToNull = PromiseWrapper.resolve(null);
@ -318,9 +318,3 @@ function assertTerminalComponent(component, path) {
}
}
}
function assertComponentExists(component: Type, path: string): void {
if (!isType(component)) {
throw new BaseException(`Component for route "${path}" is not defined, or is not a class.`);
}
}