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

相关内容

热门资讯

教程辅助!hhpoker免费辅... 教程辅助!hhpoker免费辅助器,约局吧如何查看是否有挂,其实是真的有挂(有挂方略)1、全新机制【...
玩家必看科普!wpk透视辅助方... 玩家必看科普!wpk透视辅助方法,aa poker辅助包,其实是有挂(真的有挂)暗藏猫腻,小编详细说...
科技新动态!xpoker辅助神... 科技新动态!xpoker辅助神器,wepoker作弊视频,其实有挂(有挂神器)1、在插件功能辅助器技...
科普分享!wepoker有透视... 科普分享!wepoker有透视底牌吗,pokemmo免费脚本,都是存在有挂(真的有挂)一、游戏安装教...
每日必看教程!德普之星透视,w... 每日必看教程!德普之星透视,wepoker有透视功能吗,好像有挂(有挂解密)1、每日必看教程!德普之...
我来教大家!哈糖大菠萝怎么开挂... 我来教大家!哈糖大菠萝怎么开挂,wpk有辅助器吗,其实真的有挂(真的有挂)1、许多玩家不知道辅助怎么...
科普常识!大菠萝免费辅助,hh... 科普常识!大菠萝免费辅助,hh poker辅助器先试用,确实有挂(了解有挂)1、大菠萝免费辅助透视辅...
最新研发!hhpoker透视工... 最新研发!hhpoker透视工具,wepoker透视器免费,都是存在有挂(有挂细节)1、用户打开应用...
三分钟了解!wepoker有没... 三分钟了解!wepoker有没有辅助,wepoker怎么获得好牌,确实存在有挂(真实有挂)所有人都在...
科普常识!xpoker辅助控制... 科普常识!xpoker辅助控制,we poker插件,都是是真的有挂(有挂透视)1、下载好透视辅助下...