Message Service
Uses RXjs services to passes information between components.
Methods & Examples:
-
sendMessage: To send a message using thesendMessagemethod, you can call it and pass the message as an argument. For example:import { messageService } from "gbs-fwk-core"; messageService.sendMessage({ key: "bb_toast", // unique key }); -
clearMessages: To clear any messages, you can call theclearMessagesmethod without any arguments. For example:import { messageService } from 'gbs-fwk-core'; messageService.clearMessages(); -
getMessage: To receive messages, you can call thegetMessagemethod and subscribe to the returned observable. For example:import { messageService } from 'gbs-fwk-core'; messageService.getMessage().subscribe(message => { console.log(message); // This will print the messages sent using sendMessage() });