Closed MihaiHoriaPopescu closed 6 years ago
Hello,
On that property you should emit the full array of notification you want to show.
For that you can use the notification service as seen here: https://github.com/TwanoO67/bootstraping-ngx-admin-lte/blob/master/src/app/app.component.ts
@TwanoO67 Sorry but i did not understand how to do it.
Can you make an example of how i can delete one element of the array of notifications?
Through the https://github.com/TwanoO67/ngx-admin-lte/blob/develop/src/services/notifications.service.ts
You can access the full notification list, remove the one you don't want anymore, and submit the rest
But the notificationList is private.
Yes but you can access the "notifications" subject to receive the last version of it
Sorry but i dont really know how to use the rxjs lib (Subject, ReplaySubject). Can you make an example of how to modify/delete elements using the "notifications" property? Thanks.
To modify something you have the stream of updates.
myNotifService.updates.next(function(notification: Notification): INotificationsOperation { return (notifications: Notification[]) => { //here you can access the full tab of notifications // search and modify or delete the one you want // then return the full tab return notifications; }; });
If you want more big picture advise on rxjs I recommend this tutorial here:
Ok, thanks!
Hello, i have some problems on updating the notifications, modify one f them, delete one of them. From the source code of notification.service i saw there is a property "public updates: Subject = new Subject();" that should be used, but i dont understand how to use it.
Some sugestions?