UNPKG

@progress/kendo-angular-upload

Version:

Kendo UI Angular Upload Component

58 lines (57 loc) 1.91 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { PreventableEvent } from './preventable-event'; /** * Arguments for the `success` event. The `success` event fires when * the selected files are successfully uploaded or removed. * * ```ts-no-run * @Component({ * selector: 'my-upload', * template: ` * <kendo-upload * [saveUrl]="uploadSaveUrl" * [removeUrl]="uploadRemoveUrl" * (success)="successEventHandler($event)"> * </kendo-upload> * ` * }) * export class UploadComponent { * uploadSaveUrl = 'saveUrl'; // should represent an actual API endpoint * uploadRemoveUrl = 'removeUrl'; // should represent an actual API endpoint * * successEventHandler(e: SuccessEvent) { * console.log('The ' + e.operation + ' was successful!'); * } * } * ``` */ export class SuccessEvent extends PreventableEvent { /** * The list of the files that were uploaded or removed. */ files; /** * The operation type (`upload` or `remove`). */ operation; /** * The response object returned by the server. */ response; /** * @hidden * Constructs the event arguments for the `success` event. * @param files - The list of the files that were uploaded or removed. * @param operation - The operation type (`upload` or `remove`). * @param response - The response object returned by the server. */ constructor(files, operation, response) { super(); this.files = files; this.operation = operation; this.response = response; } }