Nativescript-geolocation Error in Anguler


#1

Hi,
I added Nativescript-geolocation plugin in to angular app, and import relevant modules as per the document.
but it gives below error

JS: ERROR Error: The module AppModule was bootstrapped, but it does not declare
"@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one
 of these.
JS: ns-renderer: ERROR BOOTSTRAPPING ANGULAR
JS: ns-renderer: The module AppModule was bootstrapped, but it does not declare
"@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one
 of these.

Appreciate your help to rectify above issue

Thanks
Namal


#2

Would you mind showcase us what you have in app.module?


#3

Hi Manojkumar,
Please find my app.module.ts below

import { NgModule,  NO_ERRORS_SCHEMA } from "@angular/core";
import { NativeScriptModule } from "nativescript-angular/nativescript.module";
import { NativeScriptHttpModule } from "nativescript-angular/http";
import { NativeScriptRouterModule } from "nativescript-angular/router";
import { appRoutes,authProviders } from "./app-routing.module";
import { AppComponent } from "./app.component";
import { LoginModule } from "./pages/login/login.module";
import { TabsModule } from "./pages/tabs/tabs.module";
import { BarcodeScanner } from 'nativescript-barcodescanner';



@NgModule({

      providers: [
            authProviders,
            BarcodeScanner  
           
            
  ],
  imports: [        
        NativeScriptModule,      
        LoginModule,
        NativeScriptHttpModule,
        NativeScriptRouterModule.forRoot(appRoutes),
        TabsModule,
        
    ],
    declarations: [
        AppComponent
    ],
    schemas: [
        NO_ERRORS_SCHEMA
    ]
})
export class AppModule { }

Thanks…


#4

I think you are missing the bootstrap entry, try adding that

  ....
    declarations: [
        AppComponent
    ],
    bootstrap: [
        AppComponent
    ],
   schemas: [
        NO_ERRORS_SCHEMA
    ]
  ...