thisライブラリを使用して、angle2 CR5タイスクリプトのファイルをアップロードしようとしています。コンポーネントのHTML側の一部である'uploader'は 'div'の既知のプロパティではないため、バインドできません
import { Component } from '@angular/core';
import { FileUploader } from 'ng2-file-upload';
// const URL = '/api/';
const URL = 'https://evening-anchorage-3159.herokuapp.com/api/';
@Component({
selector: 'app-simple-demo',
templateUrl: './simple-demo.component.html',
styleUrls: ['./simple-demo.component.css']
})
export class SimpleDemoComponent {
public uploader:FileUploader = new FileUploader({url: URL});
public hasBaseDropZoneOver:boolean = false;
public hasAnotherDropZoneOver:boolean = false;
public fileOverBase(e:any):void {
this.hasBaseDropZoneOver = e;
}
public fileOverAnother(e:any):void {
this.hasAnotherDropZoneOver = e;
}
}
:
<div ng2FileDrop
[ngClass]="{'nv-file-over': hasBaseDropZoneOver}"
(fileOver)="fileOverBase($event)"
[uploader]="uploader"
class="well my-drop-zone">
Base drop zone
</div>
私は私が持っているコンポーネントに最初のi
、そうnpm i ng2-file-upload --save
を角度"version": "1.0.0-beta.16"
を使用していますそれに文句を言う:
Can't bind to 'uploader' since it isn't a known property of 'div'. ("s': hasAnotherDropZoneOver}"
(fileOver)="fileOverAnother($event)"
[ERROR ->][uploader]="uploader"
class="well my-drop-zone">
Another drop zone
"): [email protected]:17
問題なく動作していますか?はいの場合は、ソリューションを共有できますか? –