Menus don't work on dynamic pages - Angular

Dear Support Team,

I'm struggling to make the menus work when I press the button. We have aspnetzero 11.3 with Angular and Metronic 8.

I got to the point that menus work when the page is initially loaded however if I have a button with a menu attached on the cards which dynamically load (lazy load), buttons do not trigger the menus.

<div class="card-footer text-end">
<div class="d-flex flex-stack">
<div>
<button id="testbtn" type="button" class="btn btn-sm btn-primary" data-kt-menu-trigger="click" data-kt-menu-placement="bottom-start" data-kt-menu-attach="#testbtn" data-kt-menu-overflow="true">Click
</button>
<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-800 menu-state-bg-light-primary fw-semibold w-200px" data-kt-menu="true">
<div class="menu-item px-3">
<div class="menu-content fs-6 text-dark fw-bold px-3 py-4">Quick Actions</div>
</div>
<div class="separator mb-3 opacity-75"></div>
<div class="menu-item px-3">
<a href="#" class="menu-link px-3">New Ticket</a>
</div>
<div class="menu-item px-3">
<a href="#" class="menu-link px-3">New Customer</a>
</div>
</div>
</div>
</div>
</div>

I tried with overflow true/false, attachment to parent and by id, no joy.

Any advise would be appreciated.

Kind Regards, Matt

Text formatting options
Submit

Replies (2)

Hi.

In the file src/app/_metronic/kt/kt-helpers.ts you have menuReinitialization method, which need to be called after component HTML is injected into the DOM.

Regards,
Keenthemes support

Your Support Matters!

We will highly appreciate your Metronic Review on Themeforest.
Please go to Themeforest Downloads page, select Metronic & leave your feedback.

Thank you Carmelo, we will try that!

Kind Regards, Matt

Text formatting options
Submit
Text formatting options
Submit