Reputation: 878
I have a hierarchical structure of components like
Agent
task-list (component: this also using the shared task-list-table component)
task-type (component)
preview-task (modal component)
agent.component.html (task-type, task-list and preview-task are used as a reference in this component)
Shared
task-list-table (there is a button View in this component which shows the modal popup when user click)
It's not working/showing the modal popup when I clicked on the button. I used the reference from this link for angular-bootstrap-md i.e https://mdbootstrap.com/docs/angular/modals/basic/
Upvotes: 2
Views: 225
Reputation: 357
Your usage of the modal in this scenario seems to be wrong. Use dynamic modal instead. Here's link to the documentation on implementing and using dynamic modal: https://mdbootstrap.com/docs/angular/modals/basic/#dynamic .
Mark this answer as accepted, if it works.
Upvotes: 1
Reputation: 159
Try the following approach:
1) Placed your model popup html to Agent or either parent component.
2) Create a service which would publish notification on button click. Raise or emit event on your button click of task-list-table or child component.
3) Parent component subscribe to service and a handler on parent component open model popup.
Upvotes: 1