Javascript 如何在ng repeat上创建简单的动画?
我使用的是angularJS 1.2.28 以下是源代码:Javascript 如何在ng repeat上创建简单的动画?,javascript,angularjs,Javascript,Angularjs,我使用的是angularJS 1.2.28 以下是源代码: <!DOCTYPE html> <html> <head> <style> .animate-enter { -webkit-transition: 1s linear all; /* Chrome */ transition: 1s linear all; opacity: 0; } .animate-enter.animate-enter-active {
<!DOCTYPE html>
<html>
<head>
<style>
.animate-enter {
-webkit-transition: 1s linear all; /* Chrome */
transition: 1s linear all;
opacity: 0;
}
.animate-enter.animate-enter-active {
opacity: 1;
}
</style>
<script src="js/angular.min.js"></script>
<script src="js/angular-animate.min.js"></script>
</head>
<body>
<div ng-app="" ng-controller="performersController">
<p><input type="search" ng-model="username" ></p>
they are: {{performers.length}} performers
<ul ng-animate="'animate'" ng-repeat="performer in performers | filter:username">
<li>
{{ (performer.username | uppercase) + ', ' + performer.id }}
<img ng-src="{{performer.thumb}}"/>
</li>
</ul>
</div>
<script>
function performersController($scope, $http) {
$http.get("ajax.php", {
params:{
"action":"search", "order":"username", "ethnicty":"", "keyword":""
}
}).success(function(data) {
$scope.performers = data;
});
}
</script>
</body>
</html>
.为回车设置动画{
-webkit转换:1s线性所有;/*铬*/
过渡:1s线性全部;
不透明度:0;
}
.animate-enter.animate-enter-active{
不透明度:1;
}
它们是:{performers.length}}执行者
-
{{(performer.username |大写)+','+performer.id}
函数performersController($scope,$http){
$http.get(“ajax.php”{
参数:{
“操作”:“搜索”,“顺序”:“用户名”,“种族”:“关键字”:”
}
}).成功(功能(数据){
$scope.performers=数据;
});
}
1) 动画从未出现:如何添加动画?
(我需要包括angular-animate.min.js还是angularsjs库中包含此模块?)
2) 此脚本适用于angular 1.2,但在1.3中给出了一个错误:为什么?
错误:[ng:areq]
有什么想法吗?你可以看看这个。你需要包括这个模块。