<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script src="node_modules/angular/angular.js" defer></script>
<script src="node_modules/angular-animate/angular-animate.js" defer></script>
<!-- Own script section -->
<script src="app.js" defer></script>
<!-- CSS section -->
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body ng-app="MainApp">
<div ng-controller="MainController as mainCtrl">
<span class="test" ng-init="showSpan=true" ng-click="showSpan=false" ng-show="showSpan">Test</span>
</div>
</body>
</html>
App.js:角动画不添加NG隐藏添加和NG-捉迷藏添加活性
(function() {
angular.module('MainApp', ['ngAnimate'])
.controller('MainController', function() {
});
})();
风格:
.test {
font-size: 30px;
font-weight: bold;
}
.test.ng-hide-add {
opacity: 1;
}
.test.ng-hide-add-active {
opacity: 0;
transition: opacity 1s linear;
}
角应该添加到跨越在点击ng-hide-add和ng-hide-add-active之后,但是这不会发生。为什么??我使用最新的角度和角度动画。 Angular只在点击后添加ng-hide。
我观察到的变化是,我张贴在plunker,但在我的电脑不工作相同的代码,很奇怪 –