I've taken a stab at famo.us and angular lately. I like it, but I'm having issues getting my sidenav working the way I want.
When I click any of the Test1-3 menu items, I want child menu items to slide open from beneath them. I have not yet implemented any sliding, as my current problem is that no children seem to respect the fa-index of the layout.
Update: The children load and unload just fine, it's just that they always appear at the bottom of the menu items, rather than beneath them. Am I doing something wrong with the fa-modify tags? If I was working in angular I'm pretty sure my ng-repeats would work as expected with this setup.
<fa-app>
@*<fa-grid-layout fa-options="myGridLayoutOptions">*@
<fa-sequential-layout fa-options="navCtrl.sequentialOptions">
<fa-modifier ng-repeat="item in admin" fa-size="[true, true]" @*fa-size="[true, undefined]"*@ @*fa-proportions="[1, 1]"*@>
<fa-surface>
<md-list-item ng-click="navCtrl.toggleMenuExpand($index)" @*ng-click="go(item.link)"*@>
<a>
<md-item-content md-ink-ripple layout="row">
<div class="inset">
<ng-md-icon icon="{{item.icon}}"></ng-md-icon>
</div>
<div class="inset">
{{item.title + " " + $index}}
</div>
</md-item-content>
</a>
</md-list-item>
</fa-surface>
<fa-modifier ng-if="item.active" ng-repeat="submenuItem in item.submenu">
<fa-surface fa-index="1">
<md-list-item ng-click="go(submenuItem.link)">
<a>
<md-item-content md-ink-ripple layout="row">
<div class="inset">
<ng-md-icon icon="{{submenuItem.icon}}"></ng-md-icon>
</div>
<div class="inset">
{{submenuItem.title + " " + $index}}
</div>
</md-item-content>
</a>
</md-list-item>
</fa-surface>
</fa-modifier>
</fa-modifier>
</fa-sequential-layout>
@*</fa-grid-layout>*@
</fa-app>
How would I properly make it so that any children appear correctly underneath each menu item?
Here is the array of each menu item, just to clarify.
var adminmenus = [
{
link: '/overview',
title: 'Test1',
icon: 'settings',
active: true,
submenu: [{ link: '/overview', title: 'Test1SubTest1', icon: 'settings', active: false }]
},
{
link: '/overview',
title: 'Test2',
icon: 'settings',
active: false,
submenu: [{ link: '/overview', title: 'Test2SubTest1', icon: 'settings', active: false }]
},
{
link: '/handover',
title: 'Test3',
icon: 'attach_money',
active: false,
submenu: [{ link: '/overview', title: 'Test3SubTest1', icon: 'settings', active: false }]
}
];
Update: Am I perhaps looking at the famo.us implementation in the wrong way? I saw this answer, wondering if I should generate the menu with the appropriate sub menus from the controller instead..