ngx-scanner: Can't bind to 'device' since it isn't a known property of 'zxing-scanner'.

Describe the bug It related to the following line as I have tried to copy your example on plunker.

<zxing-scanner #scanner start="cameraActive" [device]="devicex" (scanSuccess)="handleQrCodeResult($event)"></zxing-scanner>

@NgModule({
  declarations: [
    MyApp, ImageEditPage, ImageCropperComponent
  ],
  imports: [
    BrowserModule,
    CommonModule,
    HttpClientModule,
    FormsModule,
    ZXingScannerModule.forRoot(),
    TranslateModule.forRoot({
      loader: {
        'provide': TranslateLoader,
        'useFactory': (createTranslateLoader),
        'deps': [HttpClient]
      }
    }),
    IonicModule.forRoot(MyApp),
    IonicStorageModule.forRoot() 
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp, 
    ImageEditPage    
  ],
  providers: [
    AlertService,
    AssetService,
    AuthService,
    DeviceService,
    Geolocation,
    GPSService,
    LocationService,
    UserService,
    Camera,
    Crop,
    CameraService,
    TagService,
    Dialogs,
    SplashScreen,
    StatusBar,  
    { 'provide': ErrorHandler, 'useClass': IonicErrorHandler }
  ]
})

ionic 3 android 7.1.1 browser 5.0.3 cordova 8.0.0

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

Ok

  1. Google for “wrap Angular app with Cordova” to resolve your current issue
  2. Have a look at Cordova plugins for permission on the native app Good luck!

I’ve build Angular application first, then, i took production build and copied into cordova “www” folder and build output as apk. Before took apk file, i’ve tried with cordova browser the component worked as expected. But on mobile, it’s a blank screen also it not asks for camera permission also