2017-09-13 10 views
0

は、私はパスからFileDropDirectiveをインポートエラーが発生しているこの角度ドラッグ&ドロップコンポーネント

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」を持っていないと持って、角4 https://github.com/jellyjs/angular2-file-drop

でこのコンポーネントを使用してみてください[FileDropDirective]、 オブジェクトリテラルは既知のプロパティのみを指定し、 '指示文'は 'コンポーネント'タイプには存在しません。

+0

を変更しますファイルドロップ ' –

+0

しかし、ディレクティブの行にもエラーがあります:[....]、 –

+0

私はプロバイダへのディレクティブとその作業を変更します –

答えて

0

は私が見つけてangular2-」から 'angular2ファイルドロップ' インポート{FileDropModule}への変更インポート{FileDropDirective}

import { FileDropDirective } from 'angular2-file-drop; 
to 
import { FileDropModule } from 'angular2-file-drop; 

また

directives to providers and working fine 
関連する問題