-3
 const url = `${this.heroesUrl}/?id=${id}`;

What is the meaning of $ in given code. i do not know how to use $ sign in hero service example in http service. why use this $ ?

Tarun..
  • 909
  • 1
  • 8
  • 18
  • 2
    Possible duplicate of [AngularJS and its use of Dollar Variables](https://stackoverflow.com/questions/12648543/angularjs-and-its-use-of-dollar-variables) – DobromirM Feb 15 '18 at 13:58
  • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals – Kirk Larkin Feb 15 '18 at 13:58
  • Possible duplicate of [What does this symbol mean in JavaScript?](https://stackoverflow.com/questions/9549780/what-does-this-symbol-mean-in-javascript) – Quentin Feb 15 '18 at 14:01
  • Duplicate: https://stackoverflow.com/questions/27678052/what-is-the-usage-of-the-backtick-symbol-in-javascript – Quentin Feb 15 '18 at 14:01
  • Duplicate: https://stackoverflow.com/questions/36107981/what-does-this-code-in-the-node-docs-mean – Quentin Feb 15 '18 at 14:01
  • Possible duplicate of [What does this \`…${…}…\` code in the node docs mean?](https://stackoverflow.com/questions/36107981/what-does-this-code-in-the-node-docs-mean) – Sebastian Simon Feb 15 '18 at 14:08

1 Answers1

3

It is a template literal:

Template literals are enclosed by the back-tick character instead of double or single quotes. Template literals can contain placeholders. These are indicated by the dollar sign and curly braces (${expression}).

pzaenger
  • 7,620
  • 2
  • 31
  • 39