AngularJS:淡出一个元素

时间:2015-07-21 13:41:07

标签: angularjs ng-animate

我正在使用ng-animate,我把它设置为依赖注入。嗯,这不起作用。

HTML

<p ng-show="atSomeCondition" class="notice">
    Some message.
</p> 

CSS

.notice {
    -webkit-transition: all linear 2s;
    transition: all linear 2s;
    opacity: 1;
}

.notice.ng-hide {
    opacity: 0;
}

有什么建议吗?提前谢谢。

1 个答案:

答案 0 :(得分:1)

您使用的是什么版本的角度/角度动画?我只是在一个plunker中尝试了你的代码,它似乎工作正常:

http://plnkr.co/edit/aMLPgXUMmx5ZNtJfI91W?p=preview

此plunker使用版本1.4.3。

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.3/angular-animate.min.js"></script>
相关问题