-
-
Save justinyoo/9319b8207c935886bea1db04d8fb350e to your computer and use it in GitHub Desktop.
Using IoC Container in Vue.js and TypeScript App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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