-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[nestjs] How can I use this
inside mapProfile
method in some profile class
#264
Comments
You can assign it to a variable in mapProfile. mapProfile() {
const appConfig = this.appConfig;
return mapper => {
console.assert(appConfig !== undefined)
}
} |
I'm still getting I've reproduced this here |
nartc
added a commit
that referenced
this issue
Feb 22, 2021
delay the addProfile operation for the DI to resolve all dependencies of Profile classes #264
@micalevisk Check out 3.0.7 |
It works now, ty :) btw you could use |
@micalevisk feel free to submit a PR to change it :D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey!
Let's say I've this profile:
Since I can inject dependencies via constructor like:
What is the proper way (if any) to use my
this.appConfig
prop inmapProfile
while creating mappings? (AKA how to create mappings dynamically(?))I'm trying to create a mapping only if it is in development mode (
this.appConfig.isDev
), but insidemapProfile
method,this.appConfig
isundefined
😕I understand that
mapProfile
is called byAutomapperProfile
(when doingsuper(mapper)
)The text was updated successfully, but these errors were encountered: