We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

"str.match is not a function" error while using toast

Thread ID:

Created:

Updated:

Platform:

Replies:

146460 Aug 5,2019 06:17 AM UTC Aug 7,2019 06:09 PM UTC Angular - EJ 2 3
loading
Tags: Toast
Nastaran Heydari
Asked On August 5, 2019 06:17 AM UTC

Hi. I've recently installed 'ej2-angular-notifications' package and in one of my component I have a toast component but when I call the show() method of the toast it doesn't appear and it throws str.match is not a function error.

here's my code:

component.html:
<ejs-toast #msg (created)="showToast($event) [position]='toastPos' ">
     <ng-template  #title>
          <div>something</div>
     <ng-template>
      <ng-template  #content>
          <div>something</div>
     <ng-template>
</ejs-toast>

component.ts:
toastPos = { X:'Right'};
@ViewChild('msg', {static:false}) toast : ToastComponent;
showToast(){
     this.toast.show();
}

how can I fix it?

Narayanasamy Panneer Selvam [Syncfusion]
Replied On August 6, 2019 12:46 PM UTC

Hi Nastaran, 
 
Greetings from Syncfusion support. 
 
We have validated your query and code snippet. From the shared code snippet, we have found there is problem in your [component.html] code. 
<ejs-toast #msg (created)="showToast($event) [position]='toastPos' "> 
 
Please make sure that you have closed all the quotation mark properly. 
 
We have prepared a demo sample to meet your requirement.  
Further if you are facing same error after modifying the sample based on shared sample, then we suggest you the following solution.

-      Run npm dedupe – remove old package from application 
-          Delete package-lock.json 
-          Now run npm install 

Kindly let us know if you need further assistance on this.
 
 
Regards, 
Narayanasamy P. 


Nastaran Heydari
Replied On August 7, 2019 05:06 AM UTC

Hi.
The type is not in my project. It was just here. and I tried to update my syncfusion projects but there's still that error.
I run npm dedupe command but nothing happened. and because my project is located in a computer that can't be connected to internet I can't run npm install in it. I have to install packages in another computer and move them to this computer.


Narayanasamy Panneer Selvam [Syncfusion]
Replied On August 7, 2019 06:09 PM UTC

Hi Nastaran, 
 
Thanks for your update. 
 
We have validated your query. Please find the details in below, 
Generally, the mentioned issue arise due to referring duplicate packages or deprecated packages. So, could you please ensure the below steps in machine which is connected to internet and generate node_modules? 
·       Remove ‘@syncfusion” folder from node_modules 
·       Ensure the all the version in package.json file 
·       Now, generate the node_modules using npm install 
·       Copy the node_modules and use it in your machine 
  
Still, you face the issue, kindly share the below details that will be helpful for us to provide a better solution as early as possible. 
  
1.       Share your project package.json file from machine (which you generate node_modules). 
2.       Share sample or code block which is used in your application to render toast component. 
 
Regards,  
Narayanasamy P.  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon