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

相关内容

热门资讯

玩家必备科普!wepoker永... 玩家必备科普!wepoker永久免费脚本(辅助挂)总是真的有挂(有挂技巧)小薇(辅助器软件下载)致您...
推荐一款!aa poker透视... 推荐一款!aa poker透视软件(辅助挂)竟然有挂(真实有挂)aa poker透视软件破解侠是真的...
传递经验!安装不了wepoke... 传递经验!安装不了wepoker(辅助挂)一直真的是有挂(有挂解惑)1)安装不了wepoker辅助插...
推荐一款!wepoker怎么发... 推荐一款!wepoker怎么发冤家牌(辅助挂)竟然真的有挂(揭秘有挂)1、完成wepoker怎么发冤...
我来分享!aapoker透视方... 我来分享!aapoker透视方法(辅助挂)果然真的是有挂(发现有挂)aapoker透视方法辅助器是一...
科普分享!wpk透视是真的假的... 科普分享!wpk透视是真的假的(辅助挂)一贯存在有挂(有挂功能)该软件可以轻松地帮助玩家将wpk透视...
一分钟了解!智星菠萝有挂吗(辅... 一分钟了解!智星菠萝有挂吗(辅助挂)都是是有挂(有挂方略)1、完成智星菠萝有挂吗有辅助插件,帮助玩家...
关于!hhpoker辅助挂(辅... 关于!hhpoker辅助挂(辅助挂)总是是真的有挂(有挂助手)1、上手简单,内置详细流程视频教学,新...
每日必备!aapoker辅助器... 每日必备!aapoker辅助器是真的吗(辅助挂)切实是有挂(有挂解密)1、下载好aapoker辅助器...
总算清楚!wepoker怎么拿... 总算清楚!wepoker怎么拿到好牌(辅助挂)真是真的有挂(确实有挂)进入游戏-大厅左侧-新手福利-...