Hi Marko,
Thank you for contacting us.
You can use the Dialog component and Toast component as an Angular service component. The service is a stateless object that contains public functions and maintains the data throughout the life of an application. These functions can be invoked from any Angular component like Controllers, Directives, and more. Please find the below sample for Dialog Component.
In above sample,
• We have created Dialog component as a separate service using @Injectable().
• In this service, we have created common functions like showDialog, hideDialog etc.
• We have shown/hidden the Dialog component with dynamically updated content using showDialog/hideDialog service method when the buttons are clicked.
Kindly check the above solution and let us know if you need any further assistance on this.
Regards,
Prince