fix(element_injector): fixed element injector to resolve dependencies of regular services

This commit is contained in:
vsavkin
2015-05-20 10:02:25 -07:00
parent c9ab8e4be8
commit 28c2b8f432
3 changed files with 45 additions and 25 deletions

View File

@ -517,6 +517,17 @@ export function main() {
expect(d.dependency).toBeAnInstanceOf(SimpleDirective);
});
it("should instantiate hostInjector injectables that have dependencies", function () {
var inj = injector([
DirectiveBinding.createFromType(SimpleDirective,
new DummyDirective({hostInjector: [
bind('injectable1').toValue('injectable1'),
bind('injectable2').toFactory((val) => `${val}-injectable2`, ['injectable1'])
]}))
]);
expect(inj.get('injectable2')).toEqual('injectable1-injectable2');
});
it("should instantiate directives that depend on app services", function () {
var appInjector = Injector.resolveAndCreate([
bind("service").toValue("service")