ng-upload-image
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

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>

Package Sidebar

Install

npm i ng-upload-image

Weekly Downloads

3

Version

0.0.4

License

MIT

Unpacked Size

175 kB

Total Files

19

Last publish

Collaborators

  • coreset