@progress/kendo-angular-menu
Version:
Kendo UI Angular Menu component
58 lines (57 loc) • 2.62 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 links of the Menu items ([see example]({% slug templates_menu %})). To define a template
* for an item, nest an `<ng-template>` tag with the `kendoMenuItemLinkTemplate` directive inside a `<kendo-menu-item>`
* component. To define a template for all Menu items, nest the template inside the `<kendo-menu>` 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 kendoMenuItemLinkTemplate let-item="item" let-index="index">
* <span [kendoMenuItemLink]="index">
* {{ item.text }}
* @if (item.items && item.items.length) {
* <span [kendoMenuExpandArrow]="index"></span>
* }
* </span>
* </ng-template>
* </kendo-menu-item>
* </kendo-menu>
* `
* })
*
* class AppComponent {
* }
* ```
*/
export class ItemLinkTemplateDirective {
templateRef;
constructor(templateRef) {
this.templateRef = templateRef;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ItemLinkTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: ItemLinkTemplateDirective, isStandalone: true, selector: "[kendoMenuItemLinkTemplate]", ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ItemLinkTemplateDirective, decorators: [{
type: Directive,
args: [{
selector: '[kendoMenuItemLinkTemplate]',
standalone: true
}]
}], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{
type: Optional
}] }] });