I would like to build a menu based on JSON returned from a service. But I can't seem to get that first menu item in the menu. If the menu has items it is easy enough to insertBefore or insertAfter but if the menu is completely empty I can't seem to find the correct referenceItem to insert after or before.
Any help would be appreciated.
Any help would be appreciated.