1

What I would like to do is have a label on the screen, say a "help line" that shows when its value changes, and then slowly fades to nothing.

Played around with CSS that animated opacity based on ng-show, thinking that maybe if I toggle the value that the ng-show="myValue" is bound to, it would cause the animation to trigger, so the opacity would fade to 0. Manually toggling the value, the CSS works fine, it shows immediately than fades to 0 over 5 seconds. But if I programmatically toggle the no-show= binding value, it doesn't have time to recognize the change (digest cycle) and it doesn't trigger the animation.

I would like to do it without a timer -- is there something in angularjs that would allow the animation to trigger when the value changes?

pinnprophead
  • 215
  • 3
  • 14
  • you could use a directive, as described in the answer to this related question: http://stackoverflow.com/a/20116524/1245971 – j.wittwer Jun 11 '14 at 22:26
  • It would be good to use a directive, but the example there, pretty much does use a timer. I guess I was hoping there would be a way to trigger a regular CSS animation. – pinnprophead Jun 12 '14 at 20:21
  • possible duplicate of [Can CSS keyframe animation be used in Angular's ng-animate directive?](http://stackoverflow.com/questions/16020883/can-css-keyframe-animation-be-used-in-angulars-ng-animate-directive) – Paul Sweatte Jul 09 '14 at 16:14

0 Answers0