Hi there,
We are having hard times to get our notifications right. Here is how our application works.
We have created a custom NotifcationService that abstracts notification for both desktops (Kendo UI) and mobiles (Ionic). Application components can trigger our NotificationService whenever needed. For instance, for the login page, we display a notification on error or success. Our notifications always have a title / header and a content message.
Kendo UI notification for Angular provides three different ways: string (doesn't allow html tags), TemplateRef and Component.
- The first option would have been perfect if we would have been able to put some tags to format the output.
- The second option has not been considered given our abstraction logic.
- We gave a try to the third option but without success for the time being. We created a custom NoticationComponent with two inputs: title (string) and message (string). We used ComponentFactoryResolver to get an instance of our Component and send it our variables. But when we try to use its instancefor NotificationSettings.content it fails:
Type
'NotificationComponent'
is not assignable to type
'string | Function | TemplateRef<any>'
whereas passing NotificationComponent directly to NotificationSettings.content works well (but it is then not possible to pass input variables).
Are we missing something here? What would have been nice is either to:
- Allow tags in content string
- Manage an alternative object such as title, message
- Allow input parameters for Component rendering case
Thanks
C.