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

相关内容

热门资讯

近日!哈糖大菠萝可以开挂吗,智... 近日!哈糖大菠萝可以开挂吗,智星菠萝辅助,都是真的是有挂(有挂透视)1、全新机制【智星菠萝辅助ai辅...
最强版aapoker万能辅助器... 最强版aapoker万能辅助器,扑克之星辅助,切实有挂(真是有挂)1、让任何用户在无需安装教程第三方...
黑科技辅助挂!hhpoker俱... 黑科技辅助挂!hhpoker俱乐部是干嘛的,德普之星怎么设置埋牌,总是确实有挂(有挂详情)德普之星怎...
最强版hh poker辅助器先... 最强版hh poker辅助器先试用,破解辅助插件wepoker,果然真的是有挂(有挂详情);1、下载...
最强版wpk模拟器多开,wep... 最强版wpk模拟器多开,wepoker透视苹果系统,总是是真的有挂(有挂助手)最强版wpk模拟器多开...
此事引发网友热议!wepoke... 此事引发网友热议!wepoker开辅助能查到吗,德扑圈有透视吗,切实是真的有挂(真的有挂)运德扑圈有...
最强版德普之星透视辅助插件,w... 最强版德普之星透视辅助插件,werplan免费挂下载,切实真的有挂(有挂分享)1)辅助插件:进一步探...
经核实!德州局怎么透视,智星菠... 经核实!德州局怎么透视,智星菠萝有挂吗,原来是真的有挂(有挂分析)1、实时智星菠萝有挂吗透视辅助更新...
最强版steampokerma... 最强版steampokermaster辅助,hhpoker透视脚本,切实是有挂(竟然有挂)1、这是跨...
无独有偶!德普之星透视辅助软件... 无独有偶!德普之星透视辅助软件,德普之星私人局透视,本来真的有挂(了解有挂)1、进入到德普之星透视辅...