Angular无法看到或读取ngx-file-drop库
创始人
2024-10-30 01:31:33
0

可能是您没有正确地导入ngx-file-drop模块或在组件中没有正确使用指令。请按照以下步骤进行操作:

1.安装ngx-file-drop库:

npm i ngx-file-drop

2.在您的ngModule中导入FileDropModule:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FileDropModule } from 'ngx-file-drop';

import { AppComponent } from './app.component';

@NgModule({
  imports:      [ BrowserModule, FileDropModule ],
  declarations: [ AppComponent ],
  bootstrap:    [ AppComponent ]
})
export class AppModule { }

3.在您的组件中使用FileDropDirective指令:

import { Component } from '@angular/core';
import { FileDropDirective, FileUploader } from 'ngx-file-drop';

@Component({
  selector: 'my-app',
  template: '
Drop your files here
' }) export class AppComponent { public uploader:FileUploader = new FileUploader({url:'https://evening-anchorage-3159.herokuapp.com/api/'}); public fileOver(event){ console.log(event); } public fileDrop(event){ console.log(event); } }

这是一个简单的使用ngx-file-drop库的组件示例。希望这可以解决您在Angular中无法看到或读取ngx-file-drop库的问题。

相关内容

热门资讯

玩家必看分享!wepoker私... 玩家必看分享!wepoker私人局规律,hhpoker辅助,都是真的是有挂(确实有挂)1、金币登录送...
分享开挂内幕!hhpoker是... 分享开挂内幕!hhpoker是真的假的,poker world辅助器,都是有挂(有挂方略)1、模拟器...
总算了解!wepoker底牌透... 总算了解!wepoker底牌透视,拱趴大菠萝有挂吗,真是真的有挂(有挂解惑)1、起透看视 辅助软件价...
六分钟了解!hhpoker可以... 六分钟了解!hhpoker可以控制吗,wepoker私人局怎么玩,其实是有挂(确实有挂);1、辅助软...
重大通报!wpk俱乐部是真的吗... 重大通报!wpk俱乐部是真的吗,德州透视hhpoker,都是是有挂(有挂方法)1、免费辅助多个强度级...
玩家爆料!佛手在线大菠萝智能辅... 玩家爆料!佛手在线大菠萝智能辅助器,wpk模拟器多开,本来有挂(有挂规律)1、玩家爆料!佛手在线大菠...
重大推荐!拱趴大菠萝作弊方法,... 重大推荐!拱趴大菠萝作弊方法,wpk模拟器多开,真是是有挂(有挂教学)1、不需要AI权限,帮助你快速...
每日必看推荐!约局吧游戏挂,w... 每日必看推荐!约局吧游戏挂,we-poker辅助,一贯真的有挂(有挂攻略)1、下载好正确养号方法之后...
今日头条!hhpoker免费辅... 今日头条!hhpoker免费辅助器,约局吧开挂,真是是真的有挂(有挂功能)1、点击下载安装,hhpo...
记者发布!hhpoker的辅助... 记者发布!hhpoker的辅助是真的吗,sohoo开挂辅助,竟然是有挂(有人有挂)1、起透看视 辅助...