From 502789dad633a603a8357eae1d5a7360bf2315bd Mon Sep 17 00:00:00 2001 From: Matthew McSparran Date: Sat, 9 Dec 2017 12:42:15 -0500 Subject: [PATCH] Updated Readme Updated to show what needs to be imported for a project to work like the demo. --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 36006ae..a422bdf 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,30 @@ Easy to use Angular2 directives for files upload ([demo](http://valor-software.g 3. More information regarding using of ***ng2-file-upload*** is located in [demo](http://valor-software.github.io/ng2-file-upload/) and [demo sources](https://github.com/valor-software/ng2-file-upload/tree/master/demo). + +## Using ***ng2-file-upload*** in a project + +1. Install as shown in the above section. + +2. Import `FileUploadModule` into the module that declares the component using ***ng2-file-upload***: + +```import { FileUploadModule } from 'ng2-file-upload';``` + +3. Add it to `[imports]` under `@NgModule`: + +```imports: [ ... FileUploadModule, ... ]``` + +4. Import `FileUploader` into the component: + +```import { FileUploader } from 'ng2-file-upload';``` + +5. Create a variable for the API url: + +```const URL = 'path_to_api';``` + +6. Initialize it: + +```public uploader:FileUploader = new FileUploader({url: URL}); ``` ## API for `ng2FileSelect`