dominique-mueller / angular-notifier

A well designed, fully animated, highly customizable, and easy-to-use notification library for your Angular application.
https://www.npmjs.com/package/angular-notifier
MIT License
247 stars 68 forks source link

how to support custome notifacation with customer data model. not only (nptification.type, notification.message)) #130

Open sapxiaojun0226 opened 5 years ago

sapxiaojun0226 commented 5 years ago

Hi all,

I want to show some customizing view inside of notification container, and I have define a ng-template with alias. and my ng-template need more complex data model to show.

currently, the angular-notifier only can pass notification object with only has type, message, id field, and using let-notification="notification" to pass the data.

how to support customizing data model like 'let-customData="customData"', customData is include like { "title", "description", "icon", .... }

can you support that?

BR, June

sapxiaojun0226 commented 5 years ago

and another question is how to set background color for notification container, now, it only have error/defalut/info/... type. and the background color can not set by ourself.

ysrepo commented 3 years ago

@sapxiaojun0226 I reached the custom data by merely extending the interface NotifierNotificationOptions and then in template I could access needed fields. Note, that IDE (VS code in my case) doesn't prompt me the fields, but it compiles and works ok.

AFDevMike commented 3 years ago

We ended up passing a json object string into .message and JSON.parse it from template.