Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2 expression single quote escape

Tags:

angular

I'm using Angular 2 and I would like to write something like this

*ngIf="game.Championship == 'Coupe d'Alsace'"

However I get an error because of the single quote between d and A. Is is possible to somehow escape this character?

like image 254
Maxime Matter Avatar asked Oct 07 '16 08:10

Maxime Matter


1 Answers

Usually a \\

*ngIf="game.Championship == 'Coupe d\'Alsace'"

or

*ngIf="game.Championship == 'Coupe d\\'Alsace'"

depending on where you put it.

like image 179
Günter Zöchbauer Avatar answered Oct 20 '22 19:10

Günter Zöchbauer