小编phy*_*yme的帖子

Angular 2:无法绑定到'uploader',因为它不是'input'的已知属性

我试图将ng2-file-upload模块集成到我的应用程序中.

我得到这个模板错误:无法绑定到'uploader',因为它不是'input'的已知属性

UPDATE文件夹str:

/src/app/app.module.ts

/src/app/components/layout/
                           layout.module.ts
                           other layout components files

                  /category-items
                            category-items.module.ts
                            category-items.component.ts
Run Code Online (Sandbox Code Playgroud)

在layout.module.ts中

import { LayoutComponent } from './layout.component';

declarations: [
    LayoutComponent,
Run Code Online (Sandbox Code Playgroud)

在category-items.module.ts中

import { CategoryItemsComponent } from './category-items.component';

import {FileUploadModule} from "ng2-file-upload";   

imports: [  ...FileUploadModule ... ]   
Run Code Online (Sandbox Code Playgroud)

应用程序\ app.module.ts

 import {FileUploadModule} from "ng2-file-upload";   

 imports: [  ...FileUploadModule ... ]  
Run Code Online (Sandbox Code Playgroud)

应用程序\分量\布局\类别的项目\类别的items.component.ts

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

@Component({
  selector: 'button-view',
  template: `

  <input type="file" class="form-control" name="single" ng2FileSelect [uploader]="uploader" />   

  `
  })

export class ButtonViewComponent implements ViewCell, OnInit {

...
 public …
Run Code Online (Sandbox Code Playgroud)

ng2-file-upload angular

13
推荐指数
1
解决办法
2万
查看次数

标签 统计

angular ×1

ng2-file-upload ×1