javascript - Angular binding for loading doesn't update the HTML -
javascript - Angular binding for loading doesn't update the HTML -
i trying show loading indicator whenever user clicks save button. when button clicked, state changes successfully, reverting value of loading
property on scope false state doesn't update ui.
is i'm doing wrong scope properties, or flaw angular?
here's jsbin: http://jsbin.com/xafexorope/2/edit?html,output
the reason why doesnt work because angular's internal dirty-checking loop not fired. it's because utilize standard settimeout. instead of that, either manually phone call $scope.$apply() @ end of settimeout callback, or better, utilize angular wrapper $timeout.
here updated jsbin: http://jsbin.com/devuhovaxa/3/edit
additionally here docs $timeout: https://docs.angularjs.org/api/ng/service/$timeout
javascript angularjs
Comments
Post a Comment