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

1.1.6 • Public • Published

Angular image-uploader-next

npm version Dependencies

This is a fork of ngx-image-updoader. Now supports Angular 16.

Angular image upload component with a preview and cropping features.

Demo

See demo here: demo

Install

npm install ngx-image-uploader-next --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-next';

@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 © 2020 Alexey Vladimirov

MIT © Olegas Gončarovas

Package Sidebar

Install

npm i ngx-image-uploader-next

Weekly Downloads

171

Version

1.1.6

License

MIT

Unpacked Size

231 kB

Total Files

23

Last publish

Collaborators

  • newvladimirov