-
-
Save mqtik/86c2ec6537025b2cf1eca0f8ffb5982d to your computer and use it in GitHub Desktop.
Animations faded on NG-IF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.animate-if { | |
background:white; | |
border:1px solid black; | |
padding:10px; | |
} | |
.animate-if.ng-enter, .animate-if.ng-leave { | |
transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; | |
} | |
.animate-if.ng-enter, | |
.animate-if.ng-leave.ng-leave-active { | |
opacity:0; | |
} | |
.animate-if.ng-leave, | |
.animate-if.ng-enter.ng-enter-active { | |
opacity:1; | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<label>Click me: <input type="checkbox" ng-model="checked" ng-init="checked=true" /></label><br/> | |
Show when checked: | |
<span ng-if="checked" class="animate-if"> | |
This is removed when the checkbox is unchecked. | |
</span> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment