Comments (11)
+1
Thanks for the work on these packages!
from ng2-file-upload.
@electricBonfire's approach also works for apps created from the angular CLI, with following notes:
- the entries he mentions are best made in
src/system-config.js
- there needs to be an addition made to
angular-cli-build.js
to ensure that the module is copied to vendor/ automatically (just addng2-file-upload/**/*.js
(Also ... grunt, gulp, webpack, brunch. Now, SystemJS. Grr.)
from ng2-file-upload.
I am using ng2-file-upload with https://github.com/mgechev/angular-seed .. and the following worked for me .. if anyone needs it
this.SYSTEM_CONFIG_DEV.paths['ng2-file-upload'] = `node_modules/ng2-file-upload/ng2-file-upload`; this.SYSTEM_BUILDER_CONFIG.packages['ng2-file-upload'] = { main: `ng2-file-upload.js`, defaultExtension : 'js' };
from ng2-file-upload.
I have already added this to https://github.com/valor-software/ng2-bootstrap#quick-start
same will be here too soon
from ng2-file-upload.
+1. Also, please provide bundled javascript files to include in the HTML. Right now I have no idea how to use this in my app, which javascript files I need to include, etc. Even though I really want to use it, it looks great.
from ng2-file-upload.
@mwijnands I managed to incorporate the lib doing the following:
//index.html
<script>
System.config({
packages: {
'js': {
format: 'cjs',
defaultExtension: 'js'
},
'vendor/ng2-file-upload': {
format: 'cjs',
defaultExtension: 'js'
}
},
map: {
'ng2-file-upload': 'vendor/ng2-file-upload/ng2-file-upload.js',
moment: 'vendor/moment/moment.js'
}
});
System.import('/vendor/ng2-file-upload/ng2-file-upload').then(function(){
System.import('js/boot');
}, console.error.bind(console));
</script>
Note the vendor
folder in the map
config. I have a script that moves files from node_modules
into vendor
. You may need to use node_modules/ng2-file-upload/ng2-file-upload.js
Then in my component:
import {FileUploader, FILE_UPLOAD_DIRECTIVES} from 'ng2-file-upload';
from ng2-file-upload.
@electricBonfire if you can create a fork or branch or folder with ng2-file-upload sample from here
https://github.com/valor-software/angular2-quickstart
I will really appreciate it :)
from ng2-file-upload.
@valorkin I am busy for the next week or so, I will try to put something together when things slow down. If no one else beats me to it!
from ng2-file-upload.
@valorkin: https://github.com/electricBonfire/ng2-file-upload-systemjs-quickstart
from ng2-file-upload.
This is working for me
system.config.js
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/',
},
// map tells the System loader where to look for things
map: {
'ng2-file-upload': 'npm:ng2-file-upload'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
'ng2-file-upload': {
main: 'index.js',
defaultExtension: 'js'
}
}
});
in app.module.ts
import { FILE_UPLOAD_DIRECTIVES, FileUploader} from 'ng2-file-upload';
from ng2-file-upload.
@piyukore06 I also use ng2-file-upload with https://github.com/mgechev/angular-seed , but I found a cleaner way:
//assuming you checkout the angular-seed from scratch
// in project.config.ts
let additionalPackages: ExtendPackages[] = [
{
name: 'ng2-file-upload',
path: 'node_modules/ng2-file-upload/bundles/ng2-file-upload.umd.js'
}
];
this.addPackagesBundles(additionalPackages);
//in home.module.js (OPTIONAL)
import { FileUploadModule } from 'ng2-file-upload';
@NgModule({
imports: [... FileUploadModule ...]
})
//in home.component.js
import { FileUploader } from 'ng2-file-upload';
from ng2-file-upload.
Related Issues (20)
- Processing legacy "View Engine" library - Angular 14 copile-time warning for @[email protected] HOT 5
- Signature of onFileDrop seems wrong
- Multi-File Upload - Send 2 or more requests at a time.
- onBeforeUploadItem not working in versions >1.4 HOT 1
- Support angular v 15 HOT 2
- Compatibility with Angular 15 HOT 2
- Release Angular 15 compatible ng2-file-upload package (version 4.0.0 should get tagged as latest) HOT 6
- Angular v13 peerDependency support was removed
- Angular 16 Support HOT 4
- version 1.4.0 not compatible with Ivy engine HOT 1
- Make url optional
- Drag Folder With Files
- Dealing with UploadAll Function
- Existing Files - Add to upload queue as already completed
- .upload() uploads all files, not just one
- Inquiry About Code Contribution Procedure
- Angular V17 support HOT 12
- Directive not recognized even though Module is included HOT 1
- Blob.type is empty can still pass the Mime filter
- Could the file upload widget support pasting a buffered image from clipboard?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng2-file-upload.