You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(core): support Injection by Type via reflect-metadata design:paramtypes
- from now on you can DI via typescript type information if you want to inject a class instance
instead of using @Inject() for everything
Closes: #41
BREAKING CHANGES:
- from now on ngMetadata leverages reflect-metadata polyfill, so you need to include it to your app
- also you need to add `"emitDecoratorMetadata": true` to your tsconfig.json
you cannot use @Optional() without related decorator for injecting Directives. use one of @Host|@Self()|@SkipSelf() + @Optional()`
77
+
if(isOptional&¶msMetaLength!==3){
78
+
thrownewError(
79
+
getErrorMsg(
80
+
typeOrFunc,
81
+
`you cannot use @Optional() without related decorator for injecting Directives. use one of @Host|@Self()|@SkipSelf() + @Optional()`
82
+
)
59
83
);
60
84
}
61
85
if(isSelf&&isSkipSelf){
62
-
thrownewError(`you cannot provide both @Self() and @SkipSelf() with @Inject(${injectInst.token}) for Directive Injection`);
86
+
thrownewError(
87
+
getErrorMsg(
88
+
typeOrFunc,
89
+
`you cannot provide both @Self() and @SkipSelf() with @Inject(${getFuncName(token)}) for Directive Injection`
90
+
)
91
+
);
63
92
}
64
93
if((isHost&&isSelf)||(isHost&&isSkipSelf)){
65
-
thrownewError(`you cannot provide both @Host(),@SkipSelf() or @Host(),@Self() with @Inject(${getFuncName(injectInst.token)}) for Directive Injections`);
94
+
thrownewError(
95
+
getErrorMsg(
96
+
typeOrFunc,
97
+
`you cannot provide both @Host(),@SkipSelf() or @Host(),@Self() with @Inject(${getFuncName(token)}) for Directive Injections`
0 commit comments