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:
@ -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.`);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user