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

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -