angular - Ionic-feil Geolocation ionic Uopptatt (i løfte): TypeError: Object(…) er ikke en funksjon TypeError: Object(…) er ikke en funksjon


Mens du importerer Geolocation:

import { Geolocation } from '@ionic-native/geolocation/ngx';

Får feil:

ionic Geolocation: Ionic v4 Uventet TypeError: Object(…) er ikke en funksjon

Svar #1

denne feilen oppstod når cordova-plugin ikke er installert, du må installere cordova-plugin og reservere prosjektet

ionic cordova plugin add cordova-plugin-geolocation
npm install @ionic-native/geolocation