【发布时间】:2014-10-14 01:10:38
【问题描述】:
当布尔变量设置为 true 时,我正在尝试对元素进行简单的淡入处理。之前它工作正常,直到我将我的AngularJS 版本更改为1.2.15。我做错了什么吗?
<div ng-app="myApp" ng-controller="myController">
{{ready}}
<div ng-show="ready" ng-animate="{show:'animate-show'}">hello</div>
</div>
$scope.ready = false;
function displayBox() {
$scope.ready = true;
$scope.$apply();
}
setTimeout(displayBox, 1000);
【问题讨论】:
-
您是否包含
angular-animate -
你应该这样做吗?大概就是这样。
-
是的,有一个单独的脚本。加上那个,做一个依赖引用,你应该很好
-
嗯。仍然不起作用,除非我错误地添加了依赖项。 jsfiddle.net/QErPe/117
-
在animation查看这篇文章
标签: javascript css angularjs ng-animate ng-show