Ionic - item does not bind in Nav-bar

Asked

Viewed 28 times

1

I have an icon in the Nav-bar that should show or not true/false toggle position. Testing in the view works perfectly but the result does not work in the Nav bar. Both pages use the same controller.

index.html - Nav-bar

<ion-nav-bar class="bar-stable" ng-controller="DashCtrl">
  <ion-nav-buttons side="right">
    <i class="icon ion-eye" ng-show="vaovivo.valor"></i>
  </ion-nav-buttons>
<ion-nav-bar>

Account.html - toggle

<ion-toggle ng-model="vaovivo.valor" ng-checked="vaovivo.valor">
  Modo ao Vivo
</ion-toggle>

Controllers.js

angular.module('Starter.controllers', [])

.controller('DashCtrl', function($scope,$rootScope) {    
  $scope.vaovivo = {'valor':false}
})
  • I think what you need is something like this: (I haven’t had time to study so I’m not sure) http://www.bennadel.com/blog/2595-using-scope-digest-as-a-performance-optimization-in-angularjs.htm

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.