4

I have seen the following syntax used in an Angular2 tutorial

(click)="choose('${RED}')"

which references

export const RED = '#1976d2';

I have not seen this syntax in the documentation and I'm not sure how to look it up. Is it deprecated?

Nate May
  • 3,814
  • 7
  • 33
  • 86

1 Answers1

7

This is not Angular2 related, it's pure TypeScript string interpolation or Template Strings, and it only works in .ts files, but not in .html files when you have the template content in a different file than the component class.

See also https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/template_strings

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567