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文件丢弃' –
,但也有错误的指令行:[....], –
我改变指令提供商,它的工作 –