angular-notifier icon indicating copy to clipboard operation
angular-notifier copied to clipboard

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

Open sapxiaojun0226 opened this issue 5 years ago • 3 comments

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 avatar Jul 12 '19 01:07 sapxiaojun0226

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.

sapxiaojun0226 avatar Jul 13 '19 15:07 sapxiaojun0226

@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.

ysrepo avatar Apr 27 '21 08:04 ysrepo

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

AFDevMike avatar Sep 28 '21 13:09 AFDevMike