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网页版透视方法AI 游戏攻略黑科技上线本地缓存功能,离线查阅能力开挂。提前下载对应游戏...
玩家必备教程!!wepoker... 『标题:当前标题』主打赛后复盘的 AI 游戏攻略黑科技走红,对局总结能力开挂。上传对局回放或者战绩截...
一分钟教会你!WPK德州局,德... AI 黑科技赛道又上新,这款智能处理工具堪称效率开挂,专门面向短视频创作者打造。它打通脚本撰写、AI...
技术分享!wepoker永久免... 一款 AI 游戏攻略黑科技工具上线,查攻略效率直接开挂。它整合版本更新、装备搭配、BOSS 打法、牌...
推荐一款!!德普辅助app,w... wepoker透视方法AI 游戏攻略黑科技上线本地缓存功能,离线查阅能力开挂。提前下载对应游戏攻略数...
一分钟揭秘!wpk辅助器是真的... 一分钟揭秘!wpk辅助器是真的吗,WPK有挂么辅助脚本(从来真的有辅助挂)主打本地运行的 AI 黑科...
一分钟了解!!wepoker透... 『标题:当前标题』主打赛后复盘的 AI 游戏攻略黑科技走红,对局总结能力开挂。上传对局回放或者战绩截...
信息共享!wpk俱乐部有没有辅... 信息共享!wpk俱乐部有没有辅助,德扑之星开挂透视教程工具(最初有辅助器)AI 智能体黑科技再上新,...
必胜教程!wepokerh5破... 必胜教程!wepokerh5破解,WPK透视软件下载(原来有辅助)主打本地运行的 AI 黑科技工具迎...
热点讨论!德普之星有透视辅助吗... 热点讨论!德普之星有透视辅助吗,德扑之星可以装挂吗工具(其实是有辅助器)AI 智能体黑科技再上新,自...