feat(ElementInjector): change ElementInjector to accept bindings or types
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user