sovanna / angular-material-sidenav

Simple component that reproduce the Angular Material Style SideNav Menu from their own website
http://sovanna.github.io/angular-material-sidenav/
109 stars 55 forks source link

Make setVisible work on immediate child of a section #10

Closed NHMD closed 8 years ago

NHMD commented 8 years ago

With this small addition, setVisible will work on toggle type elements of the menu as well:

ssSideNavSectionsProvider.initWithSections([{
                id: 'toogle_1',
                name: 'Section Heading 1',
                type: 'heading',
                children: [{
                    id: 'toogle_1_baselink',     // <-- You can hide / show this also now
                    name: 'Toogle 1',
                    type: 'toggle',
                    hidden: true,
                    pages: [{
                        id: 'toogle_1_link_1',
                        name: 'item 1',
                        state: 'common.toggle1.item1'
                    }, {
                        id: 'toogle_1_link_2',
                        name: 'item 2',
                        state: 'common.toggle1.item2',
                        hidden: true
                    }, {
                        id: 'toogle_1_link_3',
                        name: 'item 3',
                        state: 'common.toggle1.item3'
                    }]
                }]
            }]);