Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'm trying to import NativeGeocoder in the app.module of my project. But I get this error #41

Closed
CarlosEstevez13 opened this issue Feb 18, 2019 · 1 comment

Comments

@CarlosEstevez13
Copy link

CarlosEstevez13 commented Feb 18, 2019

Type 'NativeGeocorderOriginal' is not assignable to type 'Provider'
Type 'NativeGeocoderOriginal' is missing the following properties from type ''FactoryProvider: provide, useFactory

This is my code
`import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';

import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';

import { NativeGeocoder } from '@ionic-native/native-geocoder';

@NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
NativeGeocoder,
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}`

I would really appreciated, if you guys could help me.

@sebastianbaar
Copy link
Owner

Hey @CarlosEstevez13 ,

in Ionic 4 you have to change your import from:
import { NativeGeocoder } from '@ionic-native/native-geocoder';
to:
import { NativeGeocoder } from '@ionic-native/native-geocoder/ngx';

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants