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

相关内容

热门资讯

外挂模块!哈糖大菠萝怎么挂,p... 外挂模块!哈糖大菠萝怎么挂,poker master辅助-总是真的有辅助教程(哔哩哔哩)1、下载好哈...
外挂举措!来玩app破解,竞技... 外挂举措!来玩app破解,竞技联盟破解版最新版-总是存在有辅助方法(哔哩哔哩)在进入竞技联盟破解版最...
外挂操作!拱趴大菠萝挂,红龙p... 外挂操作!拱趴大菠萝挂,红龙poker有辅助吗-果然有辅助教程(哔哩哔哩)1、每一步都需要思考,不同...
外挂经验!哈糖大菠萝万能挂,德... 外挂经验!哈糖大菠萝万能挂,德普之星透视辅助软件-本来一直总是有辅助工具(哔哩哔哩)1、每一步都需要...
外挂法子!德州来玩辅助器,we... 外挂法子!德州来玩辅助器,werplan有挂吗-一贯一直总是有辅助教程(哔哩哔哩)1、打开软件启动之...
外挂教材!哈糖大菠萝有挂吗5个... 外挂教材!哈糖大菠萝有挂吗5个常用方法,德普辅助器怎么用-本来是真的有辅助技巧(哔哩哔哩)1、进入到...
外挂演示!来玩app破解,po... 外挂演示!来玩app破解,pokermaster脚本-果然一直都是有辅助app(哔哩哔哩)1、这是跨...
外挂课程!约局吧app有挂吗,... 外挂课程!约局吧app有挂吗,拱趴大菠萝机器人-其实一直总是有辅助脚本(哔哩哔哩)1、拱趴大菠萝机器...
外挂技法!佛手在线大菠萝智能辅... 外挂技法!佛手在线大菠萝智能辅助器,拱趴大菠萝万能辅助器-原来真的有辅助方法(哔哩哔哩)暗藏猫腻,小...
外挂绝活!德普之星私人局辅助器... 外挂绝活!德普之星私人局辅助器,拱趴大菠萝挂怎么安装-原来是有辅助app(哔哩哔哩)1、拱趴大菠萝挂...