5
I am reading ng-book 2 on Angular 2 and in one of the exercises a doubt arose. When setting up my component first code does not display the values title
and link
on the console, but the second works perfectly.
The first uses simple quotes. ' '. The second uses accentuation, . What’s the difference and why it doesn’t work?
// Não Funciona
addArticle(title: HTMLInputElement, link: HTMLInputElement): boolean{
console.log('${title.value} ${link.value}');
return false;
}
// Funciona
addArticle(title: HTMLInputElement, link: HTMLInputElement): boolean{
console.log(`${title.value} ${link.value}`);
return false;
}