Open yasir-odinesolutions opened 8 years ago
Do you have a solution?
you can write a special directive to solve this problem. in the directive use element.metisMenu() to re-register the event.then use this directive to the html ng-repeat line,so whenever the repeat end it will call this function again.
.directive('ng-metis', function ($timeout) { var directive = { restrict: 'A', link: function(scope, el, atts) { $timeout(function () { angular.element(el).metisMenu(); //angular.element("#menu").metisMenu(); }, 0); } };
I am using MetisMenu with my angularJs application. I want to add searching option in metismenu. I have added text bob on top of menu for this purpose. Application is filtering menu when I type any text in input field. Similarly it shows complete list when I removed text from search box. But when I remove the filter text then menu is not navigable anymore. Please check blow screenshots + code.
It seems that filter renders new menu list but metisMenu don’t know about those new or removed items. How can i update MetisMenu every time I update the list - or MetisMenu should listen for some events
Here is the controller code:
Bellow screenshot is showing filter list in Menu when i type in search box.
I get bellow screen after removing text from search box. Now I cannot go to third level of any menu item. Like clicking ‘Business Reports’, ‘System Reports’ menu group will not open third level menu items.
Kindly help me in resolving this issue regards, Yasir