Hello there,
How do I open links from the API service with Browser Tab?
That’s my code;
home.page.ts
openUrl(article: string){
this.browserTab.isAvailable()
.then((isAvailable: boolean) => {
if(isAvailable) {
this.browserTab.openUrl(article);
} else {
// if custom tabs are not available you may use InAppBrowser
}
});
}
home.page.html
<ion-card *ngFor="let article of data.docs" (click)="openUrl()">
<ion-img [src] = "article.featured_image"></ion-img>
<ion-card-header>
<ion-card-subtitle>{{article.news_site_long}}</ion-card-subtitle>
<ion-card-title>{{article.title}}</ion-card-title>
</ion-card-header>
<ion-card-content>
{{article.categories}}
</ion-card-content>
</ion-card>