-
Notifications
You must be signed in to change notification settings - Fork 84
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
Assigning a value to a component property #280
Comments
Hi @abbaty48, |
please how, because i try to create an instance of the component and then pass it to the create method, which is an error |
i have a component called AddCartComponet, which has a property cartBook in which has a value of undefined. so i use the create method of ngxSmartModalService dependency injection and use the AddCartComponent as the content, this works perfect but the cartBook property is alway undefined, so i need to pass a value to the cardBook property of the AddCartComponent. i hope you can help with this. |
Hi @abbaty48, please provide us a piece of code showing your issue or give us a real example on stackblitz. |
Hi, I'm having the same issue on my side. I need to modify properties on a component before displaying it.. and it's not template driven. Exemple: Consider a dumb component ModalComponent, that requires some data which can't be injected before, since it'll be created by NgxSmartModalService.
Now when I need that modal, I'll have a function that looks like that
Observations
Basically, I need a way to create a modal and modify the component properties. What do you suggest? |
Conclusion : Attempt n°1 works. A component will have the OnInit triggered whenever the modal.open() is called.
This doesn't feel right since it obliges to have a coupling between the component displayed and the modalService... but it'll do for the time being. |
Hi!!
i use a component in the create method in a code, but i need to pass a value to a property of the component
The text was updated successfully, but these errors were encountered: