my html looks as
<div class="row" align="center" ng-if="searchCtrl.valid">
<div class="col-lg-12"><button type="button" class="btn btn-default">Authorize to Instagram</button><br/></div>
</div>
the js is
app.controller('AdminController', ['$scope', function($scope){
this.valid = true;
//see if ig login exists once login is performed using google
gapi.client.instagramApi.validateIgLogin().execute(function(resp) {
if(resp && resp.hasOwnProperty('error')) {
// error
alert(resp.error.message);
}else{
//successful response
console.log(resp);
this.valid = resp.valid;
}
});
}
my service is coded to return false always. and i am expecting this to refresh ui and hide the button. its not working thoguh
$scopeupdate/assignments in your examplethis.validto$scope.valid. You'll probably have to update your binding tong-if="valid"as well.