I'm trying to update my view based on the changes that I've made to my $scope variables in the middle of the digest for that after making the required changes to my variables i'm calling $scope.$apply(), which is actually causing an exception saying $scope.$apply already in progress. Can someone help me how to resolve this issue.
this.showCart = false;
/*This function is called from the view on a ng-click*/
this.addCart=function(){
if (this.showCart === false) {
this.showCart = true;
this.hideEmptyCart = 'none';
this.showFullCart = 'initial';
this.searchRightMargin = 40;
this.updateWidth();
$scope.$apply();
}
}
$scope.$apply(). Just take it out and everything should work. - David says Reinstate Monica