everytime I code like this ${row.name}, I get this error " Unexpected template string expression".

Any help?

enter image description here

2

3 Answers

ES6 template strings should be used with backquotes, not single quotes. Replace this :

'delete the item ${row.name}' 

With this :

`delete the item ${row.name}` 

And here is the ESLint example as requested in the comments :

0

If you are not using an ES6 template string and actually want the dollar sign to print to the screen, place the following above the string declaration.

/* eslint-disable no-template-curly-in-string */ 

Sometimes its necessary to use templating characters within string, like inside anchor tags, etc.

'<a href="${' + 'OrganizationInfo.PrivacyPolicy}" target="_blank" >Privacy Policy</a>' 

Breaking the string worked for me.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.