Image changes on screen resize.
Dynamic/Responsive change of the image whenever the screen resolution changes.
by Sub Lines
HTML
<img src="http://placehold.it/{{width}}x{{height}}" id="image" ng-app ng-controller="respond">
CSS
body{margin:0;overflow:hidden}
/* resize the window to see how the placeholder image changes. */
JavaScript
function tellAngular() {
console.log("tellAngular call")
var e = document.getElementById("image")
scope = angular.element(e).scope(), scope.$apply(function () {
scope.width = window.innerWidth, scope.height = window.innerHeight
})
}
function respond() {}
document.addEventListener("DOMContentLoaded", tellAngular, !1), window.onresize = tellAngular