是否有角度的动画方法。
我有一个按钮,在点击时显示容器,过渡应该是平滑和缓慢的。
这是我尝试过的,我试过任何动画方法。
HTML:
<button ng-click="toggle = !toggle">{{toggleText}}</button>
<div class="box on" ng-show="toggle" ng-animate="'box'">
Hai I am Hiding Hai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am HidingHai I am Hiding....
</div>
JS:
var app = angular.module('my-app', [], function () {
})
app.controller('AppController', function ($scope) {
$scope.toggle = true;
$scope.$watch('toggle', function(){
$scope.toggleText = $scope.toggle ? 'Toggle!' : 'some text';
})
})