Greetings guys!
I’m kinda of new in this framework, but I have to admit that I’m loving it ( though I’m still taking a lot of time to learn and adapt to Angular).
Anyway, I’m having a problem related to the $watch cycle and nav items: using the basis of the SideMenu ionic template, I have a principal screen and a sidemenu; (The codes below are just examples of the actual program :D)
index.html:
(...)
<body ng-app="starter">
<div ng-controller="MainCtrl">
<ion-nav-view></ion-nav-view>
</div>
</body>
(...)
principal screen:
(...)
<img ng-src="img/{{tab.name}}.png" ng-click="setnewTab(-someothertab-)" />
(...)
sidemenu:
<ion-side-menus enable-menu-with-back-views="false">
<ion-side-menu-content>
<ion-nav-view name="menuContent"></ion-nav-view>
</ion-side-menu-content>
<ion-side-menu side="left">
<ion-content class="blackbackground">
<ion-list>
<ion-item nav-clean menu-close>
<h1 class="title">{{tab.name}}</h1>
</ion-item>
</ion-list>
</ion-content>
</ion-side-menu>
</ion-side-menus>
and, between other controllers, the MainCtrl:
(...)
$scope.tab = {name: 'somename', id: 0};
$scope.setnewTab = function(newtab) = {
$scope.tab = newtab;
}
(...)
So, even that I call the setnewTab function, and change the $scope.tab to another object, the {{tab.name}} in sidemenu doesn’t change at all (the principal screen one actually changes), so it seems that the $watch cycle is kinda of blocked in that code. I’ve tried to turn view-cache to false, but wasn’t able to solve the problem. Why’s this happening? How can I fix it?
Thanks!