I'm struggling to develop a card that, when clicked, open any Maps app from the device, mainly using this tutorial: https://www.youtube.com/watch?v=BHBLjRuzb7s
Although I coded the same code it's not working since nothing happens when I click the button.
This is my html file:
<div>
<ion-card>
<div>
<img src="{{UnitLocal}}">
</div>
<ion-item>
<button ion-button block (click)="navToMaps()">Universidade Tiradentes</button>
</ion-item>
</ion-card>
</div>
And this is my ts file:
import { Component } from '@angular/core';
import { LaunchNavigator, LaunchNavigatorOptions } from '@ionic-native/launch-navigator/ngx';
@Component({
selector: 'unitmap',
templateUrl: 'unitmap.html'
})
export class UnitmapComponent {
private UnitLocal: string;
private UnitEndereco: string;
constructor(private launchNavigator: LaunchNavigator) {
this.UnitLocal = this.getMap();
this.UnitEndereco = "Universidade Tiradentes, Aracaju";
}
navToMaps() {
console.log('Navegando para mapas');
this.launchNavigator.navigate(this.UnitEndereco);
}
}
When I run the app through the browser I'm able to get the console log, so I'm assuming the button references navToMaps correctly.