Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. class Engine {}
  2. @Injectable()
  3. class Car {
  4. engine;
  5. constructor(@Inject("MyEngine") engine:Engine) {
  6. this.engine = engine;
  7. }
  8. }
  9. var injector = Injector.resolveAndCreate([
  10. provide("MyEngine", {useClass: Engine}),
  11. Car
  12. ]);
  13. expect(injector.get(Car).engine instanceof Engine).toBe(true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement