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、实时钱塘十三水怎么开挂辅助透...
出乎意料的是!拱趴大菠萝挂哪里... 出乎意料的是!拱趴大菠萝挂哪里,德扑之星辅助器,竟然真的是有挂(有挂透明挂)1、进入游戏-大厅左侧-...
无独有偶!pokemmo手机版... 无独有偶!pokemmo手机版修改器,智星德州插件2024最新版,竟然存在有挂(有挂头条)1、该软件...
实测必看!川南休闲辅助,微信决... 实测必看!川南休闲辅助,微信决胜游戏辅助,详细app(有挂分析)1、实测必看!川南休闲辅助,微信决胜...
总结辅助挂!wepoker游戏... 总结辅助挂!wepoker游戏安装教程,德普之星透视辅助插件,都是存在有挂(有挂技巧)亲,关键说明,...
科技介绍!微信小程序填大坑辅助... 科技介绍!微信小程序填大坑辅助器,途游四川好运符,详细app(有挂分析)1、微信小程序填大坑辅助器破...
据权威媒体报道!wepoker... 据权威媒体报道!wepoker软件靠谱么,德扑之星私人局辅助器,果然真的有挂(有挂助手)1、进入游戏...
我来教教你!边锋干瞪眼跟有挂吗... 我来教教你!边锋干瞪眼跟有挂吗,潘潘讲故事app辅助,详细器(有挂教程)1、边锋干瞪眼跟有挂吗透视辅...
2026版总结!aapoker... 2026版总结!aapoker万能辅助器,德普之星透视辅助软件是真的吗,一直存在有挂(有挂方针)1、...
实测分享!新二号辅助,手游游戏... 实测分享!新二号辅助,手游游戏挂机辅助,详细脚本(的确有挂)1、不需要AI权限,帮助你快速的进行手游...