Start a new discussion

To start a new discussion please visit the discussions section of the GitHub home page of the project.

Discussions on GitHub

You can also search our old self-hosted forums for any useful information below but please note that posting new content here is not possible any more.

Re: SmartMenus with AngularJS

Home Forums Older releases 0.9.x SmartMenus with AngularJS Re: SmartMenus with AngularJS

#1632
admin
Keymaster

The initialization code is basically the following:

$('#main-menu').smartmenus({
	subMenusSubOffsetX: 1,
	subMenusSubOffsetY: -8
});

So in your case you would need to call this as soon as the menu element is populated by the AngularJS code.

In case you need to call this before the HTML is inserted (for any reason), you can then call the refresh API method after it is populated to refresh your menu tree:

$('#main-menu').smartmenus('refresh');

You can find a short code sample in the docs:

http://www.smartmenus.org/docs/#refreshInstance

Cheers!