javascript - Why won't my view get updated in Angular Js? -


i'm trying error handling web app ; more specifically, want display error message whenever server fails deliver message client.

i have controller called controller(using callback function after getting http response) on event(error) , aforementioned controller supposed set ng-hide attribute of div containing error messages false seems view isn't getting updated new value. so, div , message never displayed. i've tried can't seem figure out problem. thank you!

here code error handling controller

var errorctrl=function($scope,$timeout){ $scope.errordivhide = true; $scope.$on("error", function(event, error){ var statustxt = error.statustext;  notifiyclientoferror = function(){ $timeout(function(){  $scope.errordivhide = false; console(string(errordivhide));// prints false, should div wont appear  $scope.message = "error :"+string(statustxt); }); } notifyclientoferror(); 

here html

<div ng-controller ="errorctrl">   <div id ="errordiv" ng-hide = "errordivhide"/>      {{message}}    </div>    <p> {{errordivhide}} </p> ( wanted see value; happened true   after updated in controller) </div> 


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -