Angular:无法绑定到 'uploader',但 FileUploadModule 已导入同一模块

Angular: Can't bind to 'uploader' but FileUploadModule is imported in same module

我在使用 ng2-file-upload 的 [uploader] 文件删除指令时遇到了一个奇怪的问题。 Angular 编译器输出为:

Can't bind to 'uploader' since it isn't a known property of 'div'.

我在这个网站上搜索过任何类似的问题,但从我的角度来看,一切都是正确的:

app.module:

[...]
import { SongFilesComponent } from './components/songs/song-files/song-files.component';
import { FileUploadModule } from 'ng2-file-upload';

@NgModule({
  declarations: [
    [...]
    SongFilesComponent
  ],
  imports: [
    [...]
    FileUploadModule,
    AppRoutingModule,
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {}

歌曲文件组件:

[...]
<div
  [uploader]="newFileUploader"
  (fileOver)="onFileOverNew($event)"
  [class.file-over]="fileOverNew"
>
  Drop file here
</div>
[...]

但我总是得到描述的错误。 我有第二个简单的测试项目,上传器工作。但是我找不到他们两者之间的任何区别。

整个项目托管在https://github.com/smuddy/wgenerator/tree/master/WEB

您缺少您尝试使用的组件选择器(DIV 元素不是 angular 组件,并且没有任何 uploader 输入)。

您需要更换:

[...]
<div
  [uploader]="newFileUploader"
  (fileOver)="onFileOverNew($event)"
  [class.file-over]="fileOverNew"
>
  Drop file here
</div>
[...]

来自

[...]
<div ng2FileDrop
  [uploader]="newFileUploader"
  (fileOver)="onFileOverNew($event)"
  [class.file-over]="fileOverNew"
>
  Drop file here
</div>
[...]