src/ui/menu/smart-hamburger-menu/smart-hamburger-menu.component.ts
AbstractSmartComponent
providers |
SmartMenuStructureService
|
selector | smart-hamburger-menu |
templateUrl | ./smart-hamburger-menu.component.html |
Properties |
Methods |
Inputs |
Outputs |
constructor(menuStructureService: SmartMenuStructureService)
|
||||||
Parameters :
|
expanded |
Type : boolean
|
If set to true, will expand the menu on initialization. |
menu-structure-code |
Type : string
|
The structure code that the Smart Menu should use. |
selected-item |
Type : any
|
The currently selected menu item. |
selected-item-changed |
Type : EventEmitter<any>
|
Fires when the menu's selection changes. |
handleOpenStateChange | ||||||
handleOpenStateChange(event: any)
|
||||||
Parameters :
Returns :
void
|
onItemAction | ||||||
onItemAction(item: HamburgerMenuStructureItem)
|
||||||
Parameters :
Returns :
void
|
childItems |
Type : QueryList<SmartHamburgerMenuItemComponent>
|
Decorators :
@ViewChildren(SmartHamburgerMenuItemComponent)
|
menuItems |
Type : HamburgerMenuStructureItem[]
|
Default value : []
|
The loaded menu items. |
<nav class="navbar navbar-default navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#smart-hamburger-menu">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="navbar-brand">
<ng-content select="[smart-menu-heading]"></ng-content>
</div>
</div>
<div class="collapse navbar-collapse" id="smart-hamburger-menu">
<ul class="nav navbar-nav">
<ng-container *ngFor="let item of menuItems">
<li smart-hamburger-menu-item (onSelected)="onItemAction($event)" (openStateChanged)="handleOpenStateChange($event)" [model]="item"
[ngClass]="{ 'dropdown-toggle': item.HasChild }"></li>
</ng-container>
</ul>
</div>
</div>
</nav>