Tutorial 14.2 Class and Ngclass Animation Hooks

******************************************INDEX.HTML*****************************************************
<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Example - example-animate-css-class-production</title>
  <link href="style.css" rel="stylesheet" type="text/css">
 

  <script src="//code.angularjs.org/snapshot/angular.min.js"></script>
  <script src="//code.angularjs.org/snapshot/angular-animate.js"></script>
 

 
</head>
<body ng-app="ngAnimate">
  <p>
  <button ng-click="myCssVar='css-class'">Set</button>
  <button ng-click="myCssVar=''">Clear</button>
  <br>
  <span ng-class="myCssVar">CSS-Animated Text</span>
</p>
</body>
</html>


******************************************INDEX.HTML*****************************************************

********************************************animation.css***************************************************

.css-class-add, .css-class-remove {
  transition: all 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940);
}

.css-class,
.css-class-add.css-class-add-active {
  color: red;
  font-size: 3em;
}

.css-class-remove.css-class-remove-active {
  font-size: 1em;
  color: black;
}

********************************************animation.css***************************************************

Comments

Popular posts from this blog

Tutorial 12.12 Creating a Directive that Wraps Other Elements 3

Tutorial 12.14 Creating Directives that Communicate