Feature proposal: Allow to pass in a templateRef
See original GitHub issueHi,
I’m looking at your implementation of notifications in Angular and really like your clean code. I was thinking about extending it, allowing for some more heavy customization. In my case, I cannot really use your material style as it doesn’t go well together with the Clarity design system style which is used by the app I’m working on. I would need something that looks more like this:
Still I’d like to make use of your animation, stacking behavior etc. The idea would be to allow to also pass a template reference to the NotifierService
, something like
export class SomeComponent {
...
@ViewChild('notificationTmpl) notificationTmpl;
showNotification() {
this.notifier.show({
message: msg.message,
type: msg.messageType,
template: this.notificationTmpl
});
}
Inside the notifier-notification.component
…I’d then check whether that template has been defined. If it has, then instantiate it there, passing to it the details about the message etc, and if not, just fallback to the current behavior.
What do you think about this? It would really allow to heavily customize the notifications, allowing for icons and whatever the user wants, still taking benefit from the whole logic you’ve already implemented 😄. I can provide a PR for this
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (8 by maintainers)
Top GitHub Comments
👍 Alright, PR coming soon
Closed by https://github.com/dominique-mueller/angular-notifier/pull/95.