<!DOCTYPE html>

    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="style.css">
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.min.js"></script>
    <script src="https://code.angularjs.org/1.2.18/angular-animate.min.js"></script>
    <script src="script.js"></script>

    <h1>AngularJS Animations - Fade Out - CSS Transition Example</h1>
    <div ng-app="exampleApp" ng-init="fadeOut=false">
      <button ng-click="fadeOut=!fadeOut">{{fadeOut ? "Reset" : "Fade Out"}}</button>
      <div class="animate-me" ng-hide="fadeOut">
         <i class="fa fa-spinner fa-spin fa-lg"></i>
         <span class="loading-text">Loading</span>
var exampleApp = angular.module("exampleApp", ["ngAnimate"]);

.animate-me {
  border: 1px solid;
  width: 80px;
  padding: 4px;
  background-color: gray;
  box-shadow: 8px 8px 5px #888888;

.animate-me.ng-hide-add {
  opacity: 1.0;
  display: block !important;
  transition: opacity 3s;

.animate-me.ng-hide-add-active { 
  opacity: 0;

.loading-text {
  padding: 2px;
  color: white;

.fa-spinner {
  color: white;

button {
  margin-bottom: 10px;
#AngularJS Animations - CSS Transitions
The following plunk shows how to fade out a loading label using the new 
AngularJS animation library. This example uses CSS Transitions