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_b.ts
15 lines
(11 loc)
•
277 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/** * Created by Weizehua on 2017/1/17. */
import
{Singleton, Inject} from
"../src/Injector"
;
import
{SingletonA} from
"./singleton_a"
;
@Singleton()
export
class
SingletonB
{
val
= Math.random()
@Inject(() => SingletonA)
public
sa: SingletonA; }