0.0.4 • Published 4 years ago

ng-upload-image v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Introduction

This is a Angular component module for upload images.

Installation

Installation is done using the npm install command:

$ npm install ng-upload-image

Add Modules to app.module.ts

note: here we are using HttpClient in the package. so you need import it to your modules too.

import { NgUploadImageModule } from 'ng-upload-image';
import { HttpClient } from '@angular/common/http';

@NgModule({
  declarations: [ /* ... */  ],
  imports: [
    /* ... */
    NgUploadImageModule,
    HttpClient,
  ],
  providers: [],
  bootstrap: [AppComponent],

})

Use Module

insert module selector to the name.component.html.

basic use

    <ng-upload-image  
        [apiUrl]= "'http://localhost:3000/uploads'"
    ></ng-upload-image>

Get feedback

if need to receive the uploaded response to the component then add (onResponse) event binder inside tags.
note: you have to create getUploadResponse(res) method in name.component.html

    <ng-upload-image
        (onResponse)="getUploadResponse($event)"  
        [apiUrl]= "'http://localhost:3000/uploads'"
    ></ng-upload-image>

set max upload count

this count value set to max image count to upload at once.

    <ng-upload-image
        [maxUploadCount]="12"
        (onResponse)="getUploadResponse($event)"  
        [apiUrl]= "'http://localhost:3000/uploads'"
    ></ng-upload-image>
0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago