Bubuhubu87 / bc-jokes

MIT License
0 stars 0 forks source link

Why service is dealing with view changes? #2

Closed adrianpawlik closed 3 years ago

adrianpawlik commented 3 years ago

https://github.com/Bubuhubu87/bc-jokes/blob/28f5380d823112e6014773dbe4c4d93695f31daa/jokes/src/app/modules/jokes/components/notification-bar/notification.service.ts#L16

Bubuhubu87 commented 3 years ago

Notification component is introduced in app.component.html, and Notification service can be injected in every possible component. That approach give us flexibility to use success/failure notification.

Could you give me better idea to improve that solution?

Bubuhubu87 commented 3 years ago

To be done with stream from service to component then component will take responsibility for rendering view.

Bubuhubu87 commented 3 years ago

Done