feat(ElementInjector): change ElementInjector to accept bindings or types

This commit is contained in:
vsavkin
2014-10-27 16:07:20 -04:00
parent 94958e084e
commit e3b772425e
2 changed files with 21 additions and 14 deletions
@@ -191,6 +191,11 @@ export function main() {
expect(() => injector([NeedDirectiveFromParent])).
toThrowError('No provider for Directive! (NeedDirectiveFromParent -> Directive)');
});
it("should accept bindings instead of directive types", function () {
var inj = injector([bind(Directive).toClass(Directive)]);
expect(inj.get(Directive)).toBeAnInstanceOf(Directive);
});
});
describe("special objects", function () {