Have ideas to improve npm?Join in the discussion! »

    ngx-image-uploader
    TypeScript icon, indicating that this package has built-in type declarations

    6.0.0-beta.1 • Public • Published

    Angular image uploader npm version Dependencies

    Angular image upload component with preview and cropping features

    Demo

    See demo here: demo

    Install

    npm install ngx-image-uploader --save
    

    Usage

    Add image uploader module to your module's imports

    import { NgModule } from '@angular/core';
    import { BrowserModule  } from '@angular/platform-browser';
    import { AppComponent } from './app';
     
    import { ImageUploaderModule } from 'ngx-image-uploader';
     
    @NgModule({
      imports: [BrowserModule, ImageUploaderModule],
      declarations: [AppComponent],
      bootstrap: [AppComponent]
    })
    export class AppModule {}

    Use it in your component

    import { Component } from '@angular/core';
    import { ImageUploaderOptions, FileQueueObject } from 'ngx-image-uploader';
     
    @Component({
      selector: 'example-app',
      template: '<ngx-image-uploader [options]="options" (upload)="onUpload($event)"></ngx-image-uploader>'
    })
    export class AppComponent {
      options: ImageUploaderOptions = {
          thumbnailHeight: 150,
          thumbnailWidth: 150,
          uploadUrl: 'http://some-server.com/upload',
          allowedImageTypes: ['image/png', 'image/jpeg'],
          maxImageSize: 3
      };
      
      onUpload(file: FileQueueObject) {
        console.log(file.response);
      }
    }
     

    License

    MIT © Olegas Gončarovas

    Install

    npm i ngx-image-uploader

    DownloadsWeekly Downloads

    136

    Version

    6.0.0-beta.1

    License

    MIT

    Unpacked Size

    699 kB

    Total Files

    38

    Last publish

    Collaborators

    • avatar