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

相关内容

热门资讯

WPK模拟器辅助学习!wepo... WPK模拟器辅助学习!wepoker私人局透视教程,AApokerai多功能辅助方法1、下载好wep...
WPK多开辅助器办法!wepo... WPK多开辅助器办法!wepoker辅助器如何使用,红龙PoKerai多功能辅助器攻略1、玩家可以在...
WPK方法开挂教程书!wepo... WPK方法开挂教程书!wepoker免费透视,菠萝智星德州ai多功能开挂脚本暗藏猫腻,小编详细说明w...
WPK德州局辅助器诀窍!wep... WPK德州局辅助器诀窍!wepoker透视脚本免费,微扑克ai多功能辅助器工具1、很好的工具软件,可...
WPK方法辅助器经验!德普之星... WPK方法辅助器经验!德普之星透视辅助软件是真的吗,红龙扑克ai多功能辅助器脚本1、进入到德普之星透...
WPK方法透视项目!wpk作弊... WPK方法透视项目!wpk作弊,红龙PoKerai多功能透视神器1、首先打开wpk作弊辅助器下载最新...
WPK辅助透视挂方针!wepo... WPK辅助透视挂方针!wepoker插件功能辅助器,wpkai多功能透视挂插件1、wepoker插件...
WPK真假辅助器举措!wepo... WPK真假辅助器举措!wepoker怎么开辅助,aapokerai多功能辅助器技巧1、WPK真假辅助...
WPK安装辅助器手册!有哪些免... WPK安装辅助器手册!有哪些免费的wpk作弊码,德州扑克ai多功能辅助器神器1、有哪些免费的wpk作...
WPK私人局透视挂要领!wep... WPK私人局透视挂要领!wepoker免费辅助器,微扑克ai多功能透视挂教程1、每一步都需要思考,不...