@progress/kendo-angular-upload
Version:
Kendo UI Angular Upload Component
41 lines (40 loc) • 2.51 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { Directive, TemplateRef } from '@angular/core';
import * as i0 from "@angular/core";
/**
* Used to customize the rendering of the files in the list. ([See example.](slug:templates_upload#toc-file-template))
*
* The following context variables are available in the template:
*
* * `let-files`—Provides a reference to the files which are associated with the current item.
* * `let-state`—Gets a reference to the current state of each file. If the [`batch`](slug:api_upload_uploadcomponent#toc-batch) option of the Upload is set to `true`, the field reflects the state of the whole batch.
* * `#myUpload="kendoUpload"` or `#myFileSelect="kendoFileSelect"`—Provides a reference to the instance of the Upload/FileSelect component. It is exported as `kendoUpload`/`kendoFileSelect` by using the [`exportAs`](https://angular.io/api/core/Component) metadata property.
*
* @example
* ```html
* <kendo-upload #myUpload="kendoUpload" ... >
* <ng-template kendoUploadFileTemplate let-files let-state>
* <div>Name: {{ files[0].name }} Size: {{ files[0].size }} bytes</div>
* ...
* </ng-template>
* </kendo-upload>
* ```
*/
export class FileTemplateDirective {
templateRef;
constructor(templateRef) {
this.templateRef = templateRef;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FileTemplateDirective, isStandalone: true, selector: "[kendoUploadFileTemplate], [kendoFileSelectFileTemplate]", ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileTemplateDirective, decorators: [{
type: Directive,
args: [{
selector: '[kendoUploadFileTemplate], [kendoFileSelectFileTemplate]',
standalone: true
}]
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });