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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -