@metismenu/angular
Version:
angular component for MetisMenu
74 lines (67 loc) • 2.28 kB
JavaScript
import { ɵɵdefineInjectable, Injectable, Component, ElementRef, Input, NgModule } from '@angular/core';
import MetisMenu from 'metismenujs';
class MetismenuAngularService {
constructor() { }
}
MetismenuAngularService.ɵprov = ɵɵdefineInjectable({ factory: function MetismenuAngularService_Factory() { return new MetismenuAngularService(); }, token: MetismenuAngularService, providedIn: "root" });
MetismenuAngularService.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
];
MetismenuAngularService.ctorParameters = () => [];
class MetismenuAngularComponent {
constructor(elem) {
this.elem = elem;
this.toggle = 'true';
this.parentTrigger = 'li';
this.subMenu = 'ul';
this.triggerElement = 'a';
}
ngAfterViewInit() {
this.mmOpts = {
toggle: (this.toggle.toLowerCase() === 'true'),
parentTrigger: this.parentTrigger || 'li',
subMenu: this.subMenu || 'ul',
triggerElement: this.triggerElement || 'a',
};
this.mm = new MetisMenu(this.elem.nativeElement, this.mmOpts);
}
ngOnInit() { }
ngOnDestroy() {
this.mm.dispose();
}
}
MetismenuAngularComponent.decorators = [
{ type: Component, args: [{
selector: 'metis-menu, [metis-menu]',
// inputs: ['toggle', 'parentTrigger', 'subMenu', 'triggerElement'],
template: `<ng-content></ng-content>`
},] }
];
MetismenuAngularComponent.ctorParameters = () => [
{ type: ElementRef }
];
MetismenuAngularComponent.propDecorators = {
toggle: [{ type: Input }],
parentTrigger: [{ type: Input }],
subMenu: [{ type: Input }],
triggerElement: [{ type: Input }]
};
class MetismenuAngularModule {
}
MetismenuAngularModule.decorators = [
{ type: NgModule, args: [{
declarations: [MetismenuAngularComponent],
imports: [],
exports: [MetismenuAngularComponent]
},] }
];
/*
* Public API Surface of metismenu-angular
*/
/**
* Generated bundle index. Do not edit.
*/
export { MetismenuAngularComponent, MetismenuAngularModule, MetismenuAngularService };
//# sourceMappingURL=metismenu-angular.js.map