### File

`projects/app-base-library/src/lib/angular/modules/drupal/components/menu.component.ts`

### Metadata

selector | `ab-drupal-menu`

template

    <ul *ngIf="menu.length" [ngClass]="listClass">
       <li *ngFor="let item of menu | orderBy:['link.weight','link.title'] | reverse" class="nav-item">
           <a (click)="onMenuClick(item)" class="nav-link">
               {{ item.link.title }}
               <!--{{ item.link.weight }}-{{ item.link.title }}-->
           </a>
       </li>
     </ul>

### Index

###### Methods

- onMenuClick

###### Inputs

- listClass
- menu

###### Outputs

- select

### Constructor

`constructor()`
Defined in projects/app-base-library/src/lib/angular/modules/drupal/components/menu.component.ts:18

### Inputs

`listClass` | Type: `string`
Defined in projects/app-base-library/src/lib/angular/modules/drupal/components/menu.component.ts:17

`menu` | Type: `any` Default value: `[]`
Defined in projects/app-base-library/src/lib/angular/modules/drupal/components/menu.component.ts:16

### Outputs

`select` | `$event` type: `EventEmitter`
Defined in projects/app-base-library/src/lib/angular/modules/drupal/components/menu.component.ts:18

### Methods

onMenuClick
`onMenuClick(item: )`
Defined in projects/app-base-library/src/lib/angular/modules/drupal/components/menu.component.ts:22

Parameters :

Name | Optional
item | no

Returns : `void`

    import {Component, Input, Output, EventEmitter} from '@angular/core';

    @Component({
        selector: 'ab-drupal-menu',
        template: `
         <ul *ngIf="menu.length" [ngClass]="listClass">
            <li *ngFor="let item of menu | orderBy:['link.weight','link.title'] | reverse" class="nav-item">
                <a (click)="onMenuClick(item)" class="nav-link">
                    {{ item.link.title }}
                    <!--{{ item.link.weight }}-{{ item.link.title }}-->
                </a>
            </li>
          </ul> `
    })
    export class DrupalMenuComponent {
        @Input() menu: any = [];
        @Input() listClass: string;
        @Output() select = new EventEmitter();

        constructor() { }

        onMenuClick(item) {
            this.select.emit(item);
        }
    }

Legend
Html element
Component
Html element with directive

# results matching ""

# No results matching ""