Guest User

Untitled

a guest
Oct 19th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <ul class="matches">
  2. <li class="match" *ngFor="let match of matches">
  3. <div class="top" (click)="match.toggleState()">
  4. ... content of top
  5. </div>
  6. <div class="bottom" [@slideToggle]="match.getState()">
  7. ... content of bottom
  8. </div>
  9. </li>
  10. </ul>
  11.  
  12. export const slideToggle =
  13. // trigger name for attaching this animation to an element using the [@triggerName] syntax
  14. trigger('slideToggle', [
  15. state('closed', style({ height: 0 })),
  16. state('open', style({ height: '*' })),
  17. transition('closed => open', animate('250ms ease-in')),
  18. transition('open => closed', animate('250ms ease-out'))
  19. ]);
  20.  
  21. this.matches.sort((a: any, b: any) => {
  22. if (a.getModel().elapsed_time < b.getModel().elapsed_time) {
  23. return 1;
  24. } else if (a.getModel().elapsed_time > b.getModel().elapsed_time) {
  25. return -1;
  26. } else {
  27. return 0;
  28. }
  29. });
Add Comment
Please, Sign In to add comment