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

相关内容

热门资讯

终于知道!wejoker辅助器... 终于知道!wejoker辅助器要钱玩吗(辅助挂)竟然有挂(有挂辅助辅助方法)1、该软件可以轻松地帮助...
查到实测辅助!wepoker私... 查到实测辅助!wepoker私人局透视插件(辅助挂)一直是有挂(有挂规律辅助攻略)该软件可以轻松地帮...
推荐十款!德州透视hhpoke... 推荐十款!德州透视hhpoker(辅助挂)切实存在有挂(有挂秘笈辅助方法)1、实时透视辅助更新:用户...
发现一款!hhpoker是真的... 发现一款!hhpoker是真的吗(辅助挂)切实真的是有挂(有挂技巧辅助教程)1、免费辅助多个强度级别...
分享给玩家!wepoker辅助... 分享给玩家!wepoker辅助器如何使用(辅助挂)原来是真的有挂(了解有挂辅助工具)一、游戏安装教程...
技巧知识分享!wepoker有... 技巧知识分享!wepoker有没有辅助(辅助挂)竟然存在有挂(有挂实锤辅助技巧)1、上手简单,内置详...
玩家攻略!云扑克有透视吗(辅助... 玩家攻略!云扑克有透视吗(辅助挂)竟然真的是有挂(有挂分析辅助方法)1、有没有辅助教程、有透视吗等服...
今日百科!德州局怎么透视(辅助... 今日百科!德州局怎么透视(辅助挂)切实存在有挂(有挂教程辅助插件)1、完成有辅助插件,帮助玩家取得所...
一分钟了解!wejoker手机... 一分钟了解!wejoker手机版透视脚本(辅助挂)都是存在有挂(有挂工具辅助app)1、完成辅助器v...
重磅来袭!德州私人局怎么透视(... 重磅来袭!德州私人局怎么透视(辅助挂)竟然是有挂(有挂方法辅助方法)1、该软件可以轻松地帮助玩家将辅...