Dynamically updating css brightness of the image in Angular 2 or 4

Viewed 1343

I'm trying to update the brightness of the image dynamically. I'm getting error like this in console

WARNING: sanitizing unsafe style value filter:brightness(%); (see http://g.co/ng/security#xss).

Here my code

<img src="../assets/images/image.png" class="cover-img" alt="image" [style.filter]="'brightness('+ range +'%)'"> 

range is a variable

please let me know, If there is any alternative ways to achieve this.

2 Answers
Related