UNPKG
ts.di
Version:
latest (0.3.9)
0.3.9
0.3.8
0.3.7
0.3.6
0.3.5
0.3.4
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
0.0.9
0.0.8
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
Typescript写的依赖注入库。An dependency-injection library for TypeScript.
ts.di
/
test
/
singleton_a.ts
16 lines
(11 loc)
•
278 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/** * Created by Weizehua on 2017/1/17. */
import
{Singleton, Inject} from
"../src/Injector"
;
import
{SingletonB} from
"./singleton_b"
@Singleton()
export
class
SingletonA
{
val
= Math.random()
@Inject(() => SingletonB)
public
sb: SingletonB; }