|
|
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; |
|
|
|
import { Location } from '@angular/common'; |
|
|
|
import { MatchService } from '../services/match.service'; |
|
|
|
import { ToastService } from '../services/toast.service'; |
|
|
|
import { SocialSharing } from '@ionic-native/social-sharing/ngx'; |
|
|
|
|
|
|
|
export interface MobileAppStanding { |
|
|
|
id: string; |
|
|
@@ -31,9 +32,24 @@ export class LeagueTablePage implements OnInit { |
|
|
|
constructor( |
|
|
|
private location: Location, |
|
|
|
private matchService: MatchService, |
|
|
|
private toastService: ToastService |
|
|
|
private toastService: ToastService, |
|
|
|
private socialSharing: SocialSharing, |
|
|
|
) { } |
|
|
|
|
|
|
|
|
|
|
|
share() { |
|
|
|
let message = 'IPL League Table Standings 2021- '; |
|
|
|
|
|
|
|
for (let i = 0; i < this.standings.length; i += 1) { |
|
|
|
message += this.standings[i].short_name + (i + 1 === this.standings.length ? '.' : ', '); |
|
|
|
} |
|
|
|
|
|
|
|
message += ' To know more please visit the link! #SaddaPunjab'; |
|
|
|
|
|
|
|
this.socialSharing.share(message, '', '', 'https://www.punjabkingsipl.in/points-table'); |
|
|
|
console.log(message, '', '', 'https://www.punjabkingsipl.in/points-table'); |
|
|
|
} |
|
|
|
|
|
|
|
ngOnInit() { |
|
|
|
this.matchService.getLeagueTable().then((data: Array<MobileAppStanding>) => { |
|
|
|
this.standings = data; |
|
|
|