Animate.css和Angularjs ng-hide

Mig*_*-.o 8 angularjs animate.css ng-animate ng-show ng-hide

我正在学习和试验Angularjs和animate.css.当ng-show为true或false时,我试图添加动画.显示和隐藏的作品,但不是动画.希望有人在这里可以告诉我我做错了什么.

这是插件.

谢谢您的帮助.

wiz*_*owl 10

这是一个稍微修改过的代码版本,其中ng-show和animate.css一起工作.

HTML

<div ng-controller="controller">
  <button ng-click="showme = !showme">Show or Hide</button>
  <div ng-show="showme" class="boxme">
    <h2>Box to Show and Hide</h2>
    <p>Show and hide this box using animate.css the angularway!</p>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

JavaScript的

(function() {
    var app = angular.module("theapp", ['ngAnimate']);
    var controller = function($scope){
        $scope.showme = false;
    };
    app.controller("controller", controller);
}());
Run Code Online (Sandbox Code Playgroud)

CSS

.boxme.ng-hide-add {
    -webkit-animation: fadeOutLeftBig 0.4s;
    display: block!important;
}
.boxme.ng-hide-remove {
    -webkit-animation: fadeInLeftBig 0.4s;
}
Run Code Online (Sandbox Code Playgroud)

http://jsfiddle.net/h58wsxcw/

请注意左侧的选项(正文标记,外部资源)必须设置为在jsfiddle上启动并运行.