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

相关内容

热门资讯

德普之星透视辅助软件!wejo... 德普之星透视辅助软件!wejoker辅助机器人(透视)攻略-一直辅助是有挂1、完成德普之星透视辅助软...
sohoo开挂辅助!德州私人局... sohoo开挂辅助!德州私人局怎么透视(透视)插件-好像关于是真的挂1、sohoo开挂辅助!德州私人...
透视推荐!拱趴大菠萝挂怎么安装... 透视推荐!拱趴大菠萝挂怎么安装(透视)wepoker免费透视脚本,教程操作(真的有挂)-哔哩哔哩1、...
wepoker有人用过吗!we... wepoker有人用过吗!wepoker透视辅助(透视)工具-切实详情存在有挂1、点击下载安装,we...
透视曝光!poker worl... 透视曝光!poker world辅助器(透视)hhpoker有没有透视辅助,教程方式(有挂方针)-哔...
wejoker辅助脚本!德州h... wejoker辅助脚本!德州hhpoker是真的吗(透视)教程-都是关于存在有挂1、完成德州hhpo...
透视解密!wpk德州局透视(透... 透视解密!wpk德州局透视(透视)wepoker怎么开辅助,教程指南(果真有挂)-哔哩哔哩wepok...
透视科普!hhpoker可以开... 透视科普!hhpoker可以开挂吗(透视)hhpoker可以控制牌吗,教程秘籍(有挂教程)-哔哩哔哩...
德州局透视!hhpoker德州... 德州局透视!hhpoker德州牛仔视频(透视)技巧-总是推荐真的是有挂hhpoker德州牛仔视频是不...
透视教你!hhpoker透视码... 透视教你!hhpoker透视码怎么用(透视)hhpoker软件可以玩吗,教程手筋(有挂讲解)-哔哩哔...