
committed by
Misko Hevery

parent
5010cf9757
commit
63f23ec0b6
25
modules/angular2/test/core/application_spec.js
vendored
25
modules/angular2/test/core/application_spec.js
vendored
@ -7,6 +7,7 @@ import {ListWrapper} from 'angular2/src/facade/collection';
|
||||
import {PromiseWrapper} from 'angular2/src/facade/async';
|
||||
import {bind, Inject} from 'angular2/di';
|
||||
import {TemplateConfig} from 'angular2/src/core/annotations/template_config';
|
||||
import {LifeCycle} from 'angular2/src/core/life_cycle/life_cycle';
|
||||
|
||||
@Component({
|
||||
selector: 'hello-app',
|
||||
@ -51,6 +52,21 @@ class HelloRootCmp3 {
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'hello-app',
|
||||
template: new TemplateConfig({
|
||||
inline: '',
|
||||
directives: []
|
||||
})
|
||||
})
|
||||
class HelloRootCmp4 {
|
||||
lc;
|
||||
|
||||
constructor(@Inject(LifeCycle) lc) {
|
||||
this.lc = lc;
|
||||
}
|
||||
}
|
||||
|
||||
export function main() {
|
||||
var fakeDoc, el, el2, testBindings;
|
||||
|
||||
@ -126,5 +142,14 @@ export function main() {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should avoid cyclic dependencies when root component requires Lifecycle through DI", (done) => {
|
||||
var injectorPromise = bootstrap(HelloRootCmp4, testBindings);
|
||||
|
||||
injectorPromise.then((injector) => {
|
||||
expect(injector.get(HelloRootCmp4).lc).toBe(injector.get(LifeCycle));
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user