import { Component, OnInit, Inject } from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; import { HttpClient } from '@angular/common/http'; import { IcsDriveService } from '@varmasagi/ics-drive'; import { IcsToastService } from '@varmasagi/ics-toast'; @Component({ selector: 'app-share', templateUrl: './share.component.html', styleUrls: ['./share.component.scss'] }) export class ShareComponent implements OnInit { constructor( public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any, private http: HttpClient, private driveService: IcsDriveService, private toastService: IcsToastService ) {} public htmlLink: string = 'test'; public htmlData: any; public assetBaseUrl = "https://s3-us-west-2.amazonaws.com/repository-leadics-test/leap/leap_icons/"; ngOnInit() { this.htmlLink = this.data.dataKey; this.whatsaapSharing(this.data.dataKey); } public whatsaapSharing(link) { this.driveService.getHtmlUrl(link).subscribe(resdata => { this.htmlData = resdata; }), err => { const message = err.message? err.message : 'Oops! Something went wrong!'; this.toastService.error(message); }; } }