ng2-file-upload icon indicating copy to clipboard operation
ng2-file-upload copied to clipboard

Update to angular 8

Open jpike88 opened this issue 5 years ago • 4 comments

[email protected] requires a peer of @angular/common@^2.3.1 || >=4.0.0 but none is installed. You must install peer dependencies yourself

jpike88 avatar May 29 '19 07:05 jpike88

I guess you have this error when you do : ng update @angular/cli @angular/core I fixed it by forcing the update, and everything works fine : ng update @angular/cli @angular/core --force By the way, ng2-file-upload doesn't work anymore if you enable ivy, so I've forked the project and rebuilt it in an angular 8 library, now it works. Sorry, it's not documented but it was initially for my own usage (to test ivy in my apps).

I changed the prefix from ng2XXX to adXXX.

import { FileItem, FileUploader } from 'ad-file-upload';
...
<input type="file" adFileSelect [uploader]="uploader" multiple
...

https://www.npmjs.com/package/ad-file-upload

adessilly avatar Jun 04 '19 10:06 adessilly

As pointed out by @adessilly, it has issues with Ivy too:


../node_modules/ng2-file-upload/file-upload/file-upload.module.d.ts:1:22 - error TS-996003: Appears in the NgModule.exports of xxxxModule, but could not be resolved to an
NgModule, Component, Directive, or Pipe class

julianobrasil avatar Jul 11 '19 23:07 julianobrasil

The problem is similar to angular-froala-wysiwyg. Both ng2-file-uploader and angular-froala-wysiwyg use ngm for building the project. For compatibility with Ivy, Angular CLI should better be used. In angular-froala-wysiwyg, someone already volunteered to perform the migration to Angular CLI: https://github.com/froala/angular-froala-wysiwyg/pull/329. The same steps can be applied to ng2-file-upload.

earshinov avatar Aug 26 '19 13:08 earshinov

@jpike88 thanks for clarifying the reported issue

Chealer avatar Aug 11 '21 15:08 Chealer