import { Component, OnInit, Input } from '@angular/core'; import { AttendeeTournamentTicketsSummary } from 'tournee.businesslogic'; @Component({ selector: 'app-future-tournament-tasks', templateUrl: './future-tournament-tasks.component.html', styleUrls: ['./future-tournament-tasks.component.css'] }) export class FutureTournamentTasksComponent implements OnInit { @Input() Summary : AttendeeTournamentTicketsSummary; _currentlyExpanded: string; constructor() { } ngOnInit() { } Toggle(zone: string) { if (!this._currentlyExpanded) { this._currentlyExpanded = zone; } else { if (this.Expanded(zone)) { this._currentlyExpanded = null; } else { this._currentlyExpanded = zone; } } } Expanded(zone: string) { return this._currentlyExpanded == zone; } ExpandCollapseText(zone: string) { if (this.Expanded(zone)) { return "Click to Collapse"; } return "Click to Expand"; } }