fix(application): also bind the root component to the injector
This commit is contained in:
parent
9c2d411450
commit
9329c0e8bc
|
@ -63,7 +63,9 @@ export function documentDependentBindings(appComponentType) {
|
|||
bind(appRecordRangeToken).toFactory((rootView) => rootView.recordRange,
|
||||
[appViewToken]),
|
||||
bind(ChangeDetector).toFactory((appRecordRange) =>
|
||||
new ChangeDetector(appRecordRange), [appRecordRangeToken])
|
||||
new ChangeDetector(appRecordRange), [appRecordRangeToken]),
|
||||
bind(appComponentType).toFactory((rootView) => rootView.elementInjectors[0].getComponent(),
|
||||
[appViewToken])
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -75,6 +75,14 @@ export function main() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should provide the application component in the injector', (done) => {
|
||||
var injectorPromise = bootstrap(HelloRootCmp, testBindings(HelloRootCmp));
|
||||
injectorPromise.then((injector) => {
|
||||
expect(injector.get(HelloRootCmp)).toBeAnInstanceOf(HelloRootCmp);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should display hello world', (done) => {
|
||||
var injectorPromise = bootstrap(HelloRootCmp, testBindings(HelloRootCmp));
|
||||
injectorPromise.then((injector) => {
|
||||
|
|
Loading…
Reference in New Issue