How to swap default image with loading.gif on ng-click and then display selected image when its loaded?
HTML -partial
<img ng-src="currentImg"> <!-- this is the default image -->
<!-- i need to swap current image with loading.gif and then display selected img from below -->
<!-- on click is changing currentImg (default image) var to ng-src -->
<img ng-click="currentImg=item.imgSmall1" ng-src="{{item.imgSmall1}}">
<img ng-click="currentImg=item.imgSmall2" ng-src="{{item.imgSmall2}}">
...
JS -pseudo code
$scope.currentImg= "default img";
$scope.SETcurrentImg = function(...){
currentImg="loading.gif";
//when image is loaded display below img
// ???
currentImg="some selected img";
}