javascript

  • and then you can access your module by angular.module(‘app’) or app
  • I don’t see you included ngAnimate module in your app – Pankaj Parkar Dec 29 ’16 at 15:36
  • From you can not declare a module with the name app again, only get the instance of this module.
  • To get the instance, use angular.module function with only the module name argument.
  • What you are doing wrong is using the module “setter” function multiple times.

I read the angular animation doc and recreated the demo.
If you click the Fold In button, the text will be changed as the animate define.
The demo does not work well. The animation doesn’t work well.

@frontendbook: Can’t run the animation demo in AngularJS

If you know how to fix this bug, please write the good demo. I will vote your answer right now.

var app = angular.module(‘app’, [‘ngAnimate’]);

var app = angular.module(‘app’, [‘ngAnimate’]); app.animation(‘.fold-animation’, [‘$animateCss’, function($animateCss) { return { enter: function(element, doneFn) { var height = element[0].offsetHeight; return $animateCss(element, { addClass: ‘red large-text pulse-twice’, easing: ‘ease-out’, from: { height:’0px’ }, to: { height:height + ‘px’ }, duration: 10 // one second }); } } }]); app.controller(‘myctrl’, function ($scope) { })

.red { background:red; color: purple} .large-text { font-size:20px; } /* we can also use a keyframe animation and $animateCss will make it work alongside the transition */ .pulse-twice { animation: 0.5s pulse linear 2; -webkit-animation: 0.5s pulse linear 2; } @keyframes pulse { from { transform: scale(0.5); } to { transform: scale(1.5); } } @-webkit-keyframes pulse { from { -webkit-transform: scale(0.5); } to { -webkit-transform: scale(1.5); } }

var app = angular.module(‘app’, [‘ngAnimate’]);

angular.module(‘app’, [‘ngAnimate’]); var app = angular.module(‘app’);

javascript

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.