import { Component, OnInit } from '@angular/core'; import { TournamentAvailabilitySummaryCollection } from 'tournee.businesslogic'; import { UserProfileService } from 'src/app/shared/services/user.profile.service'; import { AuthService } from 'src/app/shared/services/auth.service'; @Component({ selector: 'app-user-selectable-listing-tournament-saved', templateUrl: './user-selectable-listing-tournament-saved.component.html', styleUrls: ['./user-selectable-listing-tournament-saved.component.css'], providers: [ UserProfileService ] }) export class UserSelectableListingTournamentSavedComponent implements OnInit { isWorking: boolean = false; Tournaments:TournamentAvailabilitySummaryCollection; constructor(private _profile: UserProfileService, public auth: AuthService) { } ngOnInit() { this.isWorking = true; this._profile.get_saved_tournaments() .then((result) => { this.Tournaments = new TournamentAvailabilitySummaryCollection(result.result); this.isWorking = false; }) .catch((err) => { console.log(err); this.isWorking = false; }); } }