1
Reply

How angularjs fade in fade out div animation working with cs

tri_inn

tri_inn

Jun 16 2017 10:07 AM
260
see my code
  1. var app = angular.module('myApp', ['ngAnimate']);  
  2. app.controller('MainController', function($scope) {  
  3. $scope.animate = false;  
  4. $scope.play = function() {  
  5. $scope.animate = !$scope.animate;  
  6. }  
  7. }); 
when animate property getting true then div is appearing with fade in effect and when animate property getting false then div is disappearing with fade out effect.

i see the code but do not understand how css is getting applied with animate property because i am new in angular and trying to learn it.
see the css
  1. .animate-show,  
  2. .animate-hide {  
  3. -webkit-transition:all linear 1s;  
  4. -moz-transition:all linear 1s;  
  5. -ms-transition:all linear 1s;  
  6. -o-transition:all linear 1s;  
  7. transition:all linear 1s;  
  8. }  
  9.   
  10. .animate-show.ng-hide-remove,  
  11. .animate-hide.ng-hide-add.ng-hide-add-active {  
  12. opacity: 0;  
  13. display: block !important;  
  14. }  
  15.   
  16. .animate-hide.ng-hide-add,  
  17. .animate-show.ng-hide-remove.ng-hide-remove-active {  
  18. opacity: 1;  
  19. display: block !important;  

.animate-show,
.animate-hide


is working with boolean property. there is also other css classes out there associated .animate-show and .animate-hide.

please help me to understand how css working with angular boolean property ?

thanks

Answers (1)