Skip to content

Commit 5bbbe8b

Browse files
Fix Injected fields usage on constructor
1 parent 04f98a8 commit 5bbbe8b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript-ioc",
3-
"version": "0.2.5",
3+
"version": "0.2.6",
44
"description": "A Lightweight annotation-based dependency injection container for typescript.",
55
"author": "Thiago da Rosa de Bustamante <[email protected]>",
66
"dependencies": {

src/typescript-ioc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,15 @@ export function AutoWired(target: Function) {
148148
newArgs.push(IoCContainer.get(paramTypes[index]));
149149
}
150150
}
151-
target.apply(this, newArgs);
152151
IoCContainer.applyInjections(this, target);
152+
target.apply(this, newArgs);
153153
}, target);
154154
}
155155
else {
156156
newConstructor = InjectorHanlder.decorateConstructor(function(...args: any[]) {
157157
IoCContainer.assertInstantiable(target);
158-
target.apply(this, args);
159158
IoCContainer.applyInjections(this, target);
159+
target.apply(this, args);
160160
}, target);
161161
}
162162
let config: ConfigImpl = <ConfigImpl>IoCContainer.bind(target)

0 commit comments

Comments
 (0)