TypeScript学习

1. <>一种为泛型,作为类型模板

另一种如下表示类型转换( Type Assertion or casting)

let square = <Square>{};
let square = {} as Square;

2. 函数完整形式:参数列表 => 返回类型 = 函数体,...args: 数组表示任意个数的参数

const Inject: (...args: any[]) => any = ioc.Inject;

3. 依赖注入typescript-ioc

github:IoC Container for Typescript 

中文博客

 

posted @ 2019-02-17 18:38  demianzhang  阅读(167)  评论(0编辑  收藏  举报