ngx-cloudinary-upload-widget
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

ngx-Cloudinary-Upload-widget

This plugin is created a wrapper around on Cloudinary Upload Widget.

Reasons to Use This Plugin

It will help you to use Plugin like Angular service.

Installation

Run the following code in your terminal:

yarn add ngx-cloudinary-upload-widget

or if you are using npm:

npm install ngx-cloudinary-upload-widget

Usage

Setup Before Initial Use

Import NgxCloudinaryWidgetModule into your root module like:

import { NgxCloudinaryWidgetModule } from 'ngx-cloudinary-upload-widget';
 
@NgModule({
  imports: [
    NgxCloudinaryWidgetModule.forRoot(
        {
            cloudName:"cloudinary_name"
        }
    )
  ]
})
export class AppModule {}
    <script src="https://widget.cloudinary.com/v2.0/global/all.js" type="text/javascript"></script>

put the above script in intex.html

import { CloudinaryWidgetManager } from 'ngx-cloudinary-widget-plugin';
 
constructor(private manager: CloudinaryWidgetManager) {}
 
  onOpen(): void {
    this.manager.open({ uploadPreset:'preset' }).subscribe((resp) => {
      console.log(resp);
    }, (err) => {
      console.log('err', err);
    }, () => {
      console.log('complete');
    });
  }

if you want to give you complete array once dialog close this is function you need to subscribe

  this.manager.onClose({ uploadPreset: 'p3cq3brm' }).subscribe((resp) => {
      console.log(resp);
    });

onClose resturn obserable<any[]>, only fire on close event.

License and copy right

© Shahid Ahmad

License under the MIT License.

Package Sidebar

Install

npm i ngx-cloudinary-upload-widget

Weekly Downloads

7

Version

0.0.7

License

MIT

Unpacked Size

51.4 kB

Total Files

21

Last publish

Collaborators

  • sa-bangash