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库的问题。

相关内容

热门资讯

必备辅助推荐!wpk辅助挂多功... 必备辅助推荐!wpk辅助挂多功能透视工具,总是是真的有挂(有挂透明挂)1、许多玩家不知道wpk辅助怎...
科普常识!AAPoKer辅助挂... 科普常识!AAPoKer辅助挂多功能透视工具,一直真的有挂(有挂详细)AAPoKer脚本下载中分为三...
重大发现!aapoker辅助挂... 重大发现!aapoker辅助挂多功能透视工具,确实真的是有挂(详细教程)1、超多福利:超高返利,海量...
盘点一款!wepoker辅助挂... 盘点一款!wepoker辅助挂多功能透视工具,真是存在有挂(新版有挂)1、每一步都需要思考,不同水平...
实操分享!德扑圈辅助挂多功能透... 实操分享!德扑圈辅助挂多功能透视工具,竟然是真的有挂(有挂方略)实操分享!德扑圈辅助挂多功能透视工具...
如何分辨真伪!wepoker辅... 如何分辨真伪!wepoker辅助挂多功能透视工具,确实存在有挂(有挂秘笈)1、让任何用户在无需wep...
技术分享!德扑圈辅助挂多功能透... 技术分享!德扑圈辅助挂多功能透视工具,总是真的有挂(真的有挂)在进入德扑圈软件靠谱后,参与本局比赛的...
一分钟了解!微扑克辅助挂多功能... 您好,微扑克这款游戏可以开挂的,确实是有挂的,需要了解加去威信【136704302】很多玩家在这款游...
普及知识!德扑圈辅助挂多功能透... 普及知识!德扑圈辅助挂多功能透视工具,总是真的有挂(有挂方法)1、游戏颠覆性的策略玩法,独创攻略技巧...
玩家必用!智星德州扑克辅助挂多... 玩家必用!智星德州扑克辅助挂多功能透视工具,一直真的是有挂(有挂教学)1、该软件可以轻松地帮助玩家将...