Box.ts
18 lines
| 318 B
| video/mp2t
|
TypeScriptLexer
|
|
r107 | import { inject } from "../di/Annotations"; | ||
| export interface Injector<T> { | ||||
| setValue(value: T); | ||||
| } | ||||
| export class Box<T> implements Injector<T> { | ||||
| private _value: T; | ||||
| @inject<Injector<T>>("bar") | ||||
| setValue(value: T) { | ||||
| this._value = value; | ||||
| } | ||||
| getValue() { | ||||
| return this._value; | ||||
| } | ||||
| } | ||||
