I am wondering why I can do this:
let stT: `${number}%` = "5435%"
But not this:
let str: string = "5435%"
let strT: `${number}%` = str;
And also not this:
let str: string = 5435
let strT: `${number}%` = `${str}%`;
What is the relationship (if any) of string and string template? Why can I assign a template a litteral but not a string variable? Is there a way you can match and convert the string to a string template?
I found this: Convert a string to a template string But I believe it to slightly different than my question.