angularjs - Angular 1.4 and using ngAnimate with JavaScript -


i'm trying setup nganimate .animation() script angular 1.4 struggling basics should display alert not :

.animation('.animated', function () {      // should display alert here...      alert('hello ?'); }) 

i must missing can't figure out what. here jsfiddle.

thanks lot help.

<div ng-app="myapp">     <div ng-controller="myctrl">         <input type="checkbox" ng-model="checked" style="float:left; margin-right:10px;" /> visible...         <span class="animatedsomething" ng-show="checked">hello {{who}}.</span>     </div> </div> 

and

angular.module('myapp', ['nganimate']) .controller('myctrl', function ($scope) {     $scope.who = 'world'; }) .animation('.animatedsomething', function () {        // should display alert here...      alert('hello ?');  }); 

seems generate alert. not sure why. quoting https://docs.angularjs.org/guide/animations "angularjs 1.3 provides animation hooks common directives such ngrepeat, ngswitch, , ngview, custom directives via $animate service.", may need 1 of directives animation applied.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -