diff --git a/README.md b/README.md index 1533768..fad1dbc 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,7 @@ The components provides following public methods: * `reset(clearUploads = false)` - Resets the widget, You can also remove all the current uploads if `clearUploads` is set to `true` * `openDialog()` - Opens Uploadcare widget dialog with current configuration. * `reject()` - Closes the dialog opened with `openDialog()` method only and discards any file selection. +* `getDialogApi()` - Returns [Dialog API instance][uc-docs-js-api-dialog-api] All methods are accessible from a parent component via the `@ViewChild()` approach. @@ -265,3 +266,4 @@ request at [hello@uploadcare.com][uc-email-hello]. [uc-docs-widget-validators]: https://uploadcare.com/docs/api_reference/javascript/file_validation/ [uc-docs-js-api-widget-on-upload-complete]: https://uploadcare.com/docs/api_reference/javascript/widget/?utm_source=github&utm_campaign=ngx-uploadcare-widget#widget-on-upload-complete [uc-docs-js-api-widget-on-change]: https://uploadcare.com/docs/api_reference/javascript/widget/?utm_source=github&utm_campaign=ngx-uploadcare-widget#widget-on-change +[uc-docs-js-api-dialog-api]: https://uploadcare.com/docs/file-uploader-api/dialog-panel/#dialog-api diff --git a/projects/ngx-uploadcare-widget/src/lib/ucWidget/ucWidget.component.ts b/projects/ngx-uploadcare-widget/src/lib/ucWidget/ucWidget.component.ts index 70f0bdf..7173c45 100644 --- a/projects/ngx-uploadcare-widget/src/lib/ucWidget/ucWidget.component.ts +++ b/projects/ngx-uploadcare-widget/src/lib/ucWidget/ucWidget.component.ts @@ -237,6 +237,10 @@ export class UcWidgetComponent implements AfterViewInit, AfterViewChecked { } } + getDialogApi() { + return this.dialog; + } + private setReinitFlag(isClearValue: boolean) { if (this.widget) { this._reinitRequired = true; diff --git a/projects/ngx-uploadcare-widget/src/lib/ucWidgetCustom/ucWidgetCustom.component.ts b/projects/ngx-uploadcare-widget/src/lib/ucWidgetCustom/ucWidgetCustom.component.ts index 3025c2b..928dff0 100644 --- a/projects/ngx-uploadcare-widget/src/lib/ucWidgetCustom/ucWidgetCustom.component.ts +++ b/projects/ngx-uploadcare-widget/src/lib/ucWidgetCustom/ucWidgetCustom.component.ts @@ -107,4 +107,7 @@ export class UcWidgetCustomComponent { } } + getDialogApi() { + return this.dialog; + } }