I am using randomly-generated images from this API: http://loremflickr.com/320/240
When the application starts, it takes a random image using that link.
When I click on a button, I want to update the image by setting the img src
-- but the URL is the same, so the browser sees the same link so does not call the api, so a new random image isn't generated.
Here is the html code:
<img style="float:right;position: relative;top: 50%;transform: translateY(-50%);" src="{{gifLoader}}"/>
The button has a click event which calls this function:
nextImg()
{
this.gifLoader = "http://loremflickr.com/" + window.screen.width + "/" + window.screen.height;
}