Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Last active March 18, 2017 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/6bf2697f492d8bd90c12d8d0c1892736 to your computer and use it in GitHub Desktop.
Save matthieu-D/6bf2697f492d8bd90c12d8d0c1892736 to your computer and use it in GitHub Desktop.
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