0

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.

1 Answers1

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