Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created March 22, 2017 04:35
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/bb2220f8d01ebd42888632f8e6eb59a1 to your computer and use it in GitHub Desktop.
Save justinyoo/bb2220f8d01ebd42888632f8e6eb59a1 to your computer and use it in GitHub Desktop.
Using IoC Container in Vue.js and TypeScript App
// Ninja.vue
<template>
<div class="ninja">
<h2>Warrior: {{ warrior }}</h2>
<h2>Weapon: {{ weapon }}</h2>
</div>
</template>
<script lang="ts">
import Ninja from "./Ninja.ts";
export default Ninja;
</script>
// Ninja.ts
import Vue from "vue";
import Component from "vue-class-component";
@Component({
name: "Ninja"
})
export default class Ninja extends Vue {
warrior: string;
weapon: string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment