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

相关内容

热门资讯

专业讨论!poker辅助软件,... 专业讨论!poker辅助软件,wpk有外挂,辅助教程(本然是真的有挂)是一款可以让一直输的玩家,快速...
透视智能ai!红龙poker作... 透视智能ai!红龙poker作弊指令,传送五激k辅助靠谱吗,黑科技教程(有挂技巧)关于传送五激k辅助...
程序员教你!wpk微扑克真的有... 程序员教你!wpk微扑克真的有挂吗,德州之星有外挂,详细教程(一向是有挂)是一款可以让一直输的玩家,...
透视透视!红龙poker作弊指... 透视透视!红龙poker作弊指令,老k麻将辅助器,专业教程(有挂神器);支持多人共享记分板与复盘,通...
一分钟了解!wepoke软件俱... 您好,微扑克辅助器ios这款游戏可以开挂的,确实是有挂的,需要了解加微【136704302】很多玩家...
透视能赢!wpk辅助插件,麻友... 此外,数据分析德州(麻友圈安庆版插件)辅助神器app还具备辅助透视行为开挂功能,通过对客户麻友圈安庆...
免费测试版!德扑之星内部,we... 免费测试版!德扑之星内部,wepoke真的有挂,科技教程(原来真的是有挂)1.wepoke真的有挂 ...
透视神器!wpk辅助软件,约战... 透视神器!wpk辅助软件,约战沙城脚本,分享教程(有挂辅助)1、不需要AI权限,帮助你快速的进行约战...
推荐一款!菠萝德州辅助神器,w... 推荐一款!菠萝德州辅助神器,wpk有外挂,辅助教程(总是真的有挂)您好,wpk有外挂,确实是有挂的,...
透视智能ai!hhpoker辅... 1、透视智能ai!hhpoker辅助软件,天天微友有辅助吗,力荐教程(有挂教程)。2、天天微友有辅助...