javascript - angular - How can jQuery inside a custom directive respond to a $scope change? -


How can jQuery react to a $ scope change in a custom command?

  & lt; Div id = "wrapper" Scrolled Directive & gt; & Lt; Div id = "scroller" & gt; Hello this is a test & lt; Div & gt; & Lt; / Div & gt;  

Note: $ timeout is only instructed to push .scrollTop () at the end of the update cycle according to this thread

  myapp.directive ($ 'Timeout') {return: 'a', link: function (scope, element, ethers) {$ timeout (function () {$ (element) .scrollTop ('scalddiakiev', function (timeout), function ($ 'timeout') Scope.mytop);}, 1);}};});  

And at the end, some $ scope codes I want to direct on

  $ scope.mytop = 500; $ Timeout (function () {$ scope.setPosition (50);}, 1000); $ Scope.setPosition = Function (Arg) {$ log.log ('=== & gt;', Arg); $ Scope.mytop = Arg; $ Scope $ apply () .; // ??? }  

Edit:

This is a JSfield with all the minimum code to run. Unfortunately jsFiddle's UI adds its scrollbar to the panel, with this Interferes! Grr But leas have all the code on it if you feel like copying it. did not listen back to Ian (see comments), but what she said inspires me to solve

. I have posted a workgroup code here

  area. $ Watch ('variableName', function () {//});  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -