TypeScript 模塊

首先介紹2個關鍵字 : export(導出,讓其他模塊可以導入使用)  和  import(導入) 先可以這麼理解 : 一個TS文件就是一個模塊。現在有一個需求 : A模塊要使用B模塊中的內容 , 也就是代碼複用問題。 其中 : Greeter.ts的代碼如下: 1 2 3 export interface StringValidator{      isAcceptable( s : strin
相關文章
相關標籤/搜索