I was trying to create an image gallery with Angular 4.The logic behind this is to add a Cascading Style Sheet (CSS) class to the selected image that will show a red border on t
Use [ngClass] and conditionally apply class based on the id.
[ngClass]
id
In your HTML file:
In your TypeScript file:
addClass(id: any) { this.id = id; }