Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70429

Same state, different parameter: Ui-sref-active="active" on both items of the menu

$
0
0

@LouisR wrote:

Hi

I have a menu wit two item leading to the same view (same state = /contact) but with different parameters passed to the view.

The only problem is with the ui-sref-active="active": when I click on the "Bug Report " item, both "Contact" and "Bug Report" items areactive`.

How to make sure Contact is not active when I click on Bug Report ?

Thanks for your help.

$stateProvider
.state('app.contact', {
            url: '/contact',
            views: {
                'menuContent': {
                    templateUrl: 'templates/contact.html',
                    controller: 'ContactCtrl'
                }
            },
            params: {
                bugReport: {
                  value: false
                }
            }
        })

and in menu.html:

<ion-item nav-clear menu-close ui-sref="app.contact" ui-sref-active="active">
  Contact
  <i class="icon ion-ios-email"></i>
</ion-item>
<ion-item nav-clear menu-close ui-sref="app.language" ui-sref-active="active">
  Language
  <i class="icon ion-earth"></i>
</ion-item>
<ion-item class="otherMenu" nav-clear menu-close ng-click="openPolicy()">
  Terms of service
  <i class="icon ion-ios-information-outline"></i>
</ion-item>
<ion-item nav-clear menu-close ui-sref="app.contact({bugReport: true})">
  Bug report
  <i class="icon ion-bug"></i>
</ion-item>

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70429

Trending Articles