Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ba-sidebar directive #53

Closed
vazh opened this issue Jun 3, 2016 · 1 comment
Closed

ba-sidebar directive #53

vazh opened this issue Jun 3, 2016 · 1 comment

Comments

@vazh
Copy link

vazh commented Jun 3, 2016

i dont know if i should wrote this as issue or feature request, i'll let you decide.

  1. currently you can add menu using baServiceProvider the thing is, if the menu was to be generated dynamically after user logging in. the list of menu are generated from database. the title property didn't actually update the title & breadcrumb inside ui-view. any idea how i should do it ?
    and it cant have order.
  2. this is actually the first problem i found with the ba-sidebar, then i resolve to the problem number.
    this is illustration how my route designed currently. all in state name.
    • login
    • app -> abstract
    • app.dashboard
    • app.charts -> abstract
    • app.charts.********

i wanted the menu to be generated like

  • dashboard
  • charts
    • chart 1
    • chart 2

i havent actually got very far. when i describe

$stateProvider
      .state('login', {
        url: '/login',
        templateUrl: 'app/user/login/user-login.html',
        controller: 'LoginController',
        controllerAs: 'vm',
        title: 'Login',
        sidebarMeta: {
          icon: 'ion-log-in',
          order: 1
        }
      })
      .state('app', {
        abstract: true,
        url: '/app',
        templateUrl: 'app/layout/layout.html'
      })
      .state('app.dashboard', {
        url: '/dashboard',
        templateUrl: 'app/pages/dashboard/dashboard.html',
        title: 'Dashboard',
        sidebarMeta: {
          icon: 'ion-android-home',
          order: 0
        }
      })

the sidebar did not have app.dashboard item. only login

@vazh
Copy link
Author

vazh commented Jun 10, 2016

anyway,
i found the problem.
i have to use parent, cant use oneline state name style for nested state.

$stateProvider
      .state('login', {
        url: '/login',
        templateUrl: 'app/user/login/user-login.html',
        controller: 'LoginController',
        controllerAs: 'vm',
        title: 'Login',
        sidebarMeta: {
          icon: 'ion-log-in',
          order: 1
        }
      })
      .state('app', {
        abstract: true,
        url: '/app',
        templateUrl: 'app/layout/layout.html'
      })
      .state('dashboard', {
        parent: 'app',
        url: '/dashboard',
        templateUrl: 'app/pages/dashboard/dashboard.html',
        title: 'Dashboard',
        sidebarMeta: {
          icon: 'ion-android-home',
          order: 0
        }
      })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant