how to hide an image when server call succeed in angularjs and html -
hello making demo of show , hide image on server calls,i have put loader image on html page , put gif file src,now image displaying,but want hide when succeed server call,my code below pls me how hide it,
html
<center><img src="images/plswait.gif" alt="what image shows" height="50" width="50" ng-show="show===5" ></center> **js** app.controller('listingdetailcontroller', function ($http, $scope, $compile, $filter, $sce) { var searchtxt = 'cay'; var url = encodeuri("http://www.yahoo.com"); var page = gallery.getcurrentpage(); var fkcategory = page.options.params; var lat=''; var lng = ''; var img = ''; var title = ''; var phone = ''; var web = ''; var email = ''; $scope.show5 = true; // console.log("===iside details======"+fkcategory); $scope.img = "http://caymanafterwork.netcluesdemo.com/cache/business/images/337_224/papagallo1438959641.jpg"; $http({ method: 'post', url: api_host+'/webservice/listingdetail', headers: { 'content-type': 'application/x-www-form-urlencoded', 'caymanauth': caymanauth }, data: "&catid=" + fkcategory + "&searchtxt=" + searchtxt, contenttype: 'application/x-www-form-urlencoded' }).success(function (data) { $scope.show5 = true;
why don't set $scope.wait = false on success function of ajax call ?
Comments
Post a Comment