Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Using IoC Container in Vue.js and TypeScript App
// configs/DependencyConfigs.ts
import { Container } from "inversify";
import "reflect-metadata";
import SERVICE_IDENTIFIER from "../models/Identifiers";
import Weapon from "../interfaces/Weapon";
import Warrior from "../interfaces/Warrior";
import { Ninja } from "../models/Warrior";
import { Shuriken } from "../models/Weapon";
let container: Container = new Container();
container.bind<Warrior>(SERVICE_IDENTIFIER.WARRIOR).to(Ninja);
container.bind<Weapon>(SERVICE_IDENTIFIER.WEAPON).to(Shuriken);
export default container;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment