fix(router): use appRootComponentToken to get root route configs

Closes #1947
This commit is contained in:
Brian Ford
2015-05-19 10:35:28 -07:00
parent 8ab773538b
commit 791caf0037
5 changed files with 91 additions and 6 deletions

View File

@ -39,7 +39,8 @@ import {DefaultDomCompiler} from 'angular2/src/render/dom/compiler/compiler';
import {internalView} from 'angular2/src/core/compiler/view_ref';
import {
appComponentRefToken
appComponentRefToken,
appComponentTypeToken
} from './application_tokens';
var _rootInjector: Injector;
@ -53,6 +54,7 @@ var _rootBindings = [
function _injectorBindings(appComponentType): List<Binding> {
return [
bind(DOCUMENT_TOKEN).toValue(DOM.defaultDoc()),
bind(appComponentTypeToken).toValue(appComponentType),
bind(appComponentRefToken).toAsyncFactory((dynamicComponentLoader, injector,
testability, registry) => {

View File

@ -1,3 +1,4 @@
import {OpaqueToken} from 'angular2/di';
export var appComponentRefToken:OpaqueToken = new OpaqueToken('ComponentRef');
export var appComponentTypeToken:OpaqueToken = new OpaqueToken('RootComponent');