angularjs - Angular scope undefined inside $watch and scope variables not available inside $animate function -


I have an animation instruction that uses scope. Look for changes to $ $ on its properties, in this case instructions. Problems I need to manipulate parental scope variables from within the $ watch or animation function. I within my instruction, but out of the clock, scope, element, and attrs parameters are defined. Inside view $ only the element is defined and the scope and the ethers are not. Prohibit: 'A', link: function (area, element, etter) {// Scope, elements, and attrs are defined here scope. $ Watch (attrs.animateGif, function (runAnim) {// only the element is defined here if (runanim) {$ animate.addClass (element, AnimLargenerGif ', function () {// a child's scope is defined here console.log ("add class callback in instructions");})} {{animate.removeClass (element,' animLargenerGif ', function) (console. Log ("in the removal instruction" Confidence callback ");})}}});}};});

Alternatively, I want to manipulate the original scope from the animation function. I got some advice on the year of Mu, who has worked for me in the "entry" animation festival in the past, but for some reason the access I have been using is not working with the controller on which the mother -Parent scope is defined, any advice on this will be greatly appreciated.

  App.Animation ('. AnnialGujargeff', function () {var alm, $ radius, parent; var getScope = function (e) {return angular.element (e) .scope ();}} {Returnclass: function (element, className, done) {$ scope = getScope (elm). $ Parent; elm = element [0]; setTimeout (function () {$ (elm). Transsection ({y : '-440px'}, 800, 'linear', function () {setTimeout (function () {$ scope.animationSetter ($ scope.largenerObj.animElm); // This function is unavailable but defined $ scope.largenerObj - Only if I get the time span of the period $ range $. Applied (); did ();}, 1000);});}, 0 );}, RemoveClass: function (element, classname, done) {console .log ("class deleted", classname); done ();}}});  

You can use the $ TIMELINE service and $ RIGHT. $ Parents are edited to edit the scope of the callback

  $ timeout (function () {scope. $ Apply (function () {scope.foo = "bar";} );});  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -