javascript - Angularjs change scope variable on window resize -


I am trying to change scope variable: $ scope.tab The size changes and the $ scope.tab == 'more' .

code:

  $ scope.closeMoreTab = function () {if ($ scope.tab == 'more') $ scope.tab = 'extra'; }; Angular.element (.bind) .bind ('resize', function) ($ scope.closeMoreTab ();});  

Well, it is actually calling $ scope.closeMoreTab () , and this is actually $ scope.tab The variable is changing, but in reality, it does not change anything on the scene.

I tried:

  console.log ($ scope);  

to check the variable tab and it actually changes to 'extras', but when I do:

 < Code> & lt; Div & gt; ; {{Tab}} & lt; / Div & gt;  

It shows me that the current tab variable is still 'more'

Please help me get stuck with this 1 hour and why not Is or what to do.

Thank you very much

You can get your $ scope.closeMoreTab () ; $ scope in $$ Apply function, as it currently changes the value, but does not do the 'triggered digest cycle:

  angular.ment ($ window) .bund (' Resize ', function) ($ radius. $ Apply (function () {$ scope.closeMoreTab ();});});  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -