Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created March 21, 2017 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinyoo/f75994e6a536d687b5938f360e651b47 to your computer and use it in GitHub Desktop.
Save justinyoo/f75994e6a536d687b5938f360e651b47 to your computer and use it in GitHub Desktop.
Using IoC Container in Vue.js and TypeScript App
// models/Weapon.ts
import { injectable } from "inversify";
import Weapon from "../interfaces/Weapon";
@injectable()
class Shuriken implements Weapon {
public constructor() {
this.name = "Shuriken";
}
public name: string;
}
@injectable()
class Katana implements Weapon {
public constructor() {
this.name = "Katana";
}
public name: string;
}
export { Shuriken, Katana };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment