wKoza / ngx-upload

Ngx-upload is an upload module for Angular Ivy ready
30 stars 15 forks source link

Error: Can't resolve all parameters for InputfileComponent: ([object Object], ?, [object Object], [object Object], [object Object]) #60

Closed kdbusiness90 closed 5 years ago

kdbusiness90 commented 5 years ago

Hello William,

I am getting an error: compiler.js:2427 Uncaught Error: Can't resolve all parameters for InputfileComponent: ([object Object], ?, [object Object], [object Object], [object Object]).

angular verison: "~7.1.0", ngx-upload version: ^8.0.0-beta.0

app.module.ts

import { DropTargetOptions, NgxUploadModule} from '@wkoza/ngx-upload';

@NgModule({
  declarations: [
    AppComponent,
  ],
  imports: [
    BrowserModule,
    HttpClientModule,
    BrowserAnimationsModule,
    AppRoutingModule,
    NgxUploadModule.forRoot(),
  ],
  providers: [AppUrlService
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

app.component.html

<form #ourForm="ngForm"> or via a simple button-like : <span class="btn btn-outline-success btn-s" *ngxInputFile="optionsInput">Upload local files</span> </form>

app.component.ts

@ViewChild('ourForm') ourForm;

  optionsInput: InputFileOptions = {
    multiple: false,
    accept: [MineTypeEnum.Image]
  };

  constructor(
    private uploader: HttpClientUploadService
  ) { }

  ngOnInit() {
    this.uploader.queue = [];

    // upload  files
    this.uploader.onCancel$.subscribe(
            (data: FileItem) => {
                console.log('file deleted: ' + data.file);

            });

        this.uploader.onProgress$.subscribe(
            (data: any) => {
                console.log('upload file in progree: ' + data.progress);

            });

        this.uploader.onSuccess$.subscribe(
            (data: any) => {
                console.log(`upload file successful:  ${data.item} ${data.body} ${data.status} ${data.headers}`);

            }
        );
  }
wKoza commented 5 years ago

Hi @kdbusiness90 , I hope to release a final version today. The beta.0 was just a test.

wKoza commented 5 years ago

hi @kdbusiness90 , I released a beta.2 yesterday; It should be good