Last active
August 29, 2015 14:27
-
-
Save kenmori/6910b1c7ca9b036b4eba to your computer and use it in GitHub Desktop.
脱TS近眼!!Typescriptと仲良くなってみる(1日目) ref: http://qiita.com/M-ISO/items/d4206b506e63da98a1e4
This file contains hidden or 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
module moritaA{ | |
export interface Imorita {//(1) | |
get: Function; | |
num1: number; | |
num2: number; | |
} | |
export class Aclass implements Imorita{ | |
public num1:number = 1 | |
public num2:number = 4 | |
constructor(){ | |
} | |
public get():number{ | |
return this.num1 + this.num2 | |
} | |
} | |
} | |
module moritaB { | |
import importedAclass = morita.Aclass;//(2) | |
export class Bclass { | |
constructor(){} | |
method = new importedAclass(); | |
} | |
} | |
var aa = new morita.Aclass; | |
console.log(aa.get()); | |
var bb = new moritaB.Bclass; | |
console.log(bb.method.get())//(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment