Toast is missing the following properties

I have used the syncfusion Angular Toast utility service like this

import{ToastUtility}from'@syncfusion/ej2-notifications';
import{ToastComponent}from'@syncfusion/ej2-angular-notifications';
export class OrderComponent{
constructor(private orderService:OrderService){}


OnSaveOrderAction(e: any){
    this.orderService.saveOrder(this.Order).subscribe((ret)=>{
      this.toastObj =ToastUtility.show({
        title:'Saved',
        content:'Saved Successfully !!!',
        timeOut:20000,
        position:{ X:'Right', Y:'Top'},
        showCloseButton:true
      },'Success',20000) as ToastComponent;
    });


}
}


but I am getting an error like this .'Toast' is missing the following properties from type 'ToastComponent': ngEle, srenderer, viewContainerRef, injector, and 10 more.

when I define it as an unknown object, the error goes. but the success green color is not showing then.

solution -

this.toastObj = ToastUtility.show({
        title: 'Saved',
        content: 'Saved Successfully !!!',
        timeOut: 20000,
        position: { X: 'Right', Y: 'Top' },
        showCloseButton: true
      }, 'Success', 20000) as unknown as ToastComponent;

Note

1 I am using the version of "@syncfusion/ej2-angular-navigations": "^25.1.35"


how can I fix this issue ?


1 Reply

UD UdhayaKumar Duraisamy Syncfusion Team May 13, 2024 11:50 AM UTC

Hello Buddhi,


We have validated the reported scenario on our end by creating a sample using the latest version (Current latest version: 25.2.3v), and the reported issue is not replicated. Therefore, we suggest that you update the Syncfusion packages to the latest version to resolve the reported issue on your end. If you encounter the same issue after updating the Syncfusion packages to the latest version, please share the requested details below. This will assist us in further validating the query and providing you with a better solution.


  • A simple, runnable sample that illustrates the issue you are experiencing (or modify the shared sample as per your scenario).

  • Video illustration of the issue.


Samplehttps://www.syncfusion.com/downloads/support/directtrac/general/ze/syncfusion-Toast-service-angular-12982510



Best Regards,

Udhaya Kumar D.


Loader.
Up arrow icon