Angular 2: Can't bind to 'uploader' since it isn't a known property of 'input'

前端 未结 2 651
感动是毒
感动是毒 2020-12-30 04:48

Im trying to integrate ng2-file-upload module into my application.

And im getting this template error: Can\'t bind to \'uploader\' since it isn\'t a known property o

相关标签:
2条回答
  • 2020-12-30 05:11

    You need to import FileUploadModule in the module that declares the component using 'upload' which in your case would be category-items.module.ts

    category-items.module.ts

    import { CategoryItemsComponent } from './category-items.component';
    
    import { FileUploadModule } from "ng2-file-upload";   //Should import HERE
    
    imports: [  ...FileUploadModule ... ]   //RIGHT PLACE
    
    0 讨论(0)
  • 2020-12-30 05:30

    add to app.module.ts this

    import { FileSelectDirective } from 'ng2-file-upload';
    @NgModule({
        imports: [
            ...
    ],
        declarations: [
            FileSelectDirective
        ],
        providers: [
            ...
    ],
        bootstrap: [
            App,
        ],
    })
    

    https://github.com/valor-software/ng2-file-upload/issues/418#issuecomment-249865170

    Or try to import FIleUploadModule to an each parent module

    import { FIleUploadModule } from 'ng2-file-upload';

    imports: [
        FIleUploadModule,
        ..........,
        ........,
        ......,
    
    ]
    

    It should work.

    0 讨论(0)
提交回复
热议问题