Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MessagesService {
- base = {
- flowEditor: {
- generatingStarted: {
- summary: 'Generating!',
- detail: 'App started generating.',
- severity: 'info'
- }
- }
- }
- send(get: (any) => any) {
- const message = get(this.base);
- this.messages.push({severity: message.severity, summary: message.heading, detail: message.details});
- this.removeAfterFewSeconds(this.messages, this.messages.indexOf({
- severity: message.severity,
- summary: message.summary,
- detail: message.detail
- }));
- }
- }
- // -------------------USAGE--------------------------------------
- this.messageService.send(get => get.flowEditor.generatingStarted);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement