javascript - AngularJS - call controller method after animation is finished -


I have a button and a hidden div when I click on the button, the division width will expand in my HTML is by now:

  & lt; Div ng-controller = "PageController" & gt; & Lt; Button ng-click = "toggle page ()> show details & lt; / div & gt; & lt; div class =" page-slide-animation "ng-show =" page "& gt; & lt; / div  

My administrator provides the following method:

  $ scope.togglePage = function () {$ Scope.page =! $ Scope.page;};  

And this is my animation:

  app.edimation ('.page-slide-animation ', [Function () {return {first adclass: function (Element, className, done) {if (className ==' ng-hide ') {jQuery (element) .animate ({width:' toggle '}, function ) {Done ();}}}}}, removeClass: Function (element, className, done) {If (className == 'ng-hide') {jQuery (element) .animate ({width: 'toggle'}, function () {done ();})}}}}}}});  

This works fine so far.What do I need to do After the animation ends, the code controller in PageController is the best way to do this (controller Using timeout in, injecting a service into animation .. ..)

one Exposing an Event with Potential Solutions $ Root Scope is. $ Emit and hold it in the controller.


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? -