Last active
March 18, 2017 20:09
-
-
Save matthieu-D/6bf2697f492d8bd90c12d8d0c1892736 to your computer and use it in GitHub Desktop.
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
import { | |
Component, | |
OnInit, | |
trigger, | |
style, | |
transition, | |
animate } from '@angular/core'; | |
@Component({ | |
selector: 'square', | |
templateUrl: 'square.component.html', | |
styleUrls: ['./square.component.css'], | |
animations: [ | |
trigger( | |
'squareState', [ | |
transition(':enter', [ | |
style({ opacity: 0 }), | |
animate('2500ms', style({ opacity: 1 })) | |
]), | |
transition(':leave', [ | |
style({ opacity: 1 }), | |
animate('2500ms', style({ opacity: 0 })) | |
]) | |
]) | |
] | |
}) | |
export class SquareComponent implements OnInit { | |
isVisible: boolean; | |
ngOnInit() { | |
this.isVisible = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment