I moved `Camera` from `app.module` to `avatar-change.module`:
```
import { NgModule } from '@angular/core';
import { IonicModule } from 'ionic-angular';
import { Camera } from "@ionic-native/camera";
import { AvatarChangeComponent } from './avatar-change';
import { SharedModule } from "../../shared/shared.module";

@NgModule({
  declarations: [AvatarChangeComponent],
  imports: [
    IonicModule,
    SharedModule
  ],
  exports: [AvatarChangeComponent],
  entryComponents: [AvatarChangeComponent],
  providers: [Camera] // <-- here
})

export class AvatarChangeComponentModule {
}

```
I use this on a `service` like this:
```
import { Camera, CameraOptions } from "@ionic-native/camera";
...
constructor(private camera: Camera) {}
```
But get this error:

> Uncaught (in promise): Error: 
> StaticInjectorError(AppModule)[ImageUploadProvider -> Camera]: 
>   StaticInjectorError(Platform: core)[ImageUploadProvider -> Camera]: 
>     NullInjectorError: No provider for Camera!

I'm using also a different native component on a similar way (component and 
provider) and that one works ok

[ Full content available at: 
https://github.com/apache/cordova-plugin-camera/issues/336 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to