Content in main view gets refreshed way too many times when using ion-menu / ion-header / ion-content


#1

Hello all !

Suppose I have an application with a side menu, like in ionic todo app [tutorial][1] :

<body ng-app="todo" ng-controller="TodoCtrl">
  <ion-side-menus>

  <!-- Center content -->
  <ion-side-menu-content>
    <ion-header-bar class="bar-dark">
      <h1 class="title">Todo</h1>
      <!-- ... -->
    </ion-header-bar>
    <ion-content>
      <!-- our list and list items -->
      <ion-list>
        <ion-item ng-repeat="task in tasks | someFilter">
          {{task.title}}
        </ion-item>
      </ion-list>
    </ion-content>
  </ion-side-menu-content>

  <!-- Left menu -->
  <ion-side-menu side="left">
    <ion-header-bar class="bar-dark">
      <!-- ... -->
    </ion-header-bar>
  </ion-side-menu>

Suppose I use a filter for the tasks in the main view (someFilter above).

It is normal that the filter is called twice when displaying the page (this is normal angular $digest mechanism).

But now the filter is called 9 times ! Apparently, about twice per ionic menu / header / content. I also have some popups in the page, so that in my “real” application the content is refreshed… 19 times.

Did I miss something ? Is it intended behavior ? Can I disable / get around it ?

Thanks in advance,

Yannick
[1]: http://ionicframework.com/docs/guide/