My goal is to provide a dynamic image by binding to the background-image attribute. Here is a Stackblitz exemplifying the current state of the problem.
As you can see...
I have tried sanitizing the string that I am feeding into the element style.
I have made sure that my syntax without making it dynamic is correct.
I checked similar issues but they were still too dissimilar to be of use: ngStyle background-image even Gunter's post didn't help: Angular 2 ngStyle and background-image
Here is the background image:
.background-image{
background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 45%, rgba(255, 255, 255, 0.9) 75%, white 110%), url("https://www.futurity.org/wp/wp-content/uploads/2018/05/reading-on-grass_1600.jpg");
I just want to put that string after background-image in the component like so:
public imgSmall = 'linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 45%, rgba(255, 255, 255, 0.9) 75%, white 110%), url("https://www.futurity.org/wp/wp-content/uploads/2018/05/reading-on-grass_1600.jpg")';
so that I can change it to a higher res when not in mobile.
I need it in this format as opposed to <img src>
format