i have a modal with several checkboxes which are populated with data i'm getting from my database. My problem is anytime i close the modal and open it, it has to load all the data again from my database and because of that i loose all the selected ,i.e checked items. Is there a way i can only load the data once and also have the checked items when the modal is closed and opened again.
Asked
Active
Viewed 473 times
0
-
Can you please post the code what you've written? – Sivakumar Tadisetti Aug 06 '18 at 09:09
1 Answers
0
Load the data in the component that launches the dialog and cache it. Then pass that data to the dialog when you launch it through the dialog config object. See https://v5.material.angular.io/components/dialog/overview#sharing-data-with-the-dialog-component-.

G. Tranter
- 16,766
- 1
- 48
- 68