0
我嘗試在角4 https://github.com/jellyjs/angular2-file-drop角拖放組件
使用這個組件我有這樣的事情
import { Component, OnInit } from '@angular/core';
import { FileDropDirective } from 'angular2-file-drop';
@Component({
selector: 'app-drag-and-drop',
template: `
<div fileDrop
[ngClass]="{'file-is-over': fileIsOver}"
[options]="options"
(fileOver)="fileOver($event)"
(onFileDrop)="onFileDrop($event)">
Drop file here
</div>
`,
directives: [ FileDropDirective ],
styleUrls: ['./drag-and-drop.component.scss']
})
export class DragAndDropComponent implements OnInit {
}
我有一個從路徑中導入FileDropDirective錯誤沒有出口成員「FileDropDirective」和行指令中也有錯誤:[FileDropDirective], 對象字面量只能指定已知屬性,而'指令'在'Component'類型中不存在。
我找到並從「angular2- 'angular2文件拖放' 到 進口{} FileDropModule進口變化{} FileDropDirective文件丟棄' –
,但也有錯誤的指令行:[....], –
我改變指令提供商,它的工作 –