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?
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?
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