@progress/kendo-angular-menu
Version:
Kendo UI Angular Menu component
54 lines (53 loc) • 2.41 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, Optional } from '@angular/core';
import * as i0 from "@angular/core";
/**
* Represents a template for the content of the Menu items ([see example]({% slug templates_menu %})). To define the template,
* nest an `<ng-template>` tag with the `kendoMenuItemContentTemplate` directive inside a `<kendo-menu-item>` component.
*
* The available fields in the template context are:
* - `item`—The item data.
* - `index`—The item index.
*
* @example
* ```ts-preview
*
* _@Component({
* selector: 'my-app',
* template: `
* <kendo-menu>
* <kendo-menu-item text="item2">
* <ng-template kendoMenuItemContentTemplate let-item="item" let-index="index">
* <div style="padding: 10px;">
* My Content Template for: {{ item.text }} at index: {{ index }}
* </div>
* </ng-template>
* </kendo-menu-item>
* </kendo-menu>
* `
* })
*
* class AppComponent {
* }
* ```
*/
export class ItemContentTemplateDirective {
templateRef;
constructor(templateRef) {
this.templateRef = templateRef;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ItemContentTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: ItemContentTemplateDirective, isStandalone: true, selector: "[kendoMenuItemContentTemplate]", ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ItemContentTemplateDirective, decorators: [{
type: Directive,
args: [{
selector: '[kendoMenuItemContentTemplate]',
standalone: true
}]
}], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{
type: Optional
}] }] });