I have a simple page as shown below.
The problem is that, even though $scope.objRef.count is updated in my directive (for example, from 7 to 8), the template shows the old value, 7, in the webview.
This happens when I switch to this state/directive/template:
How can this be? (in state tabs-page.tpl.html):
<ion-view view-title="{{objRef.count}}">
<ion-content>
</ion-content>
<ba-tabs-page></ba-tabs-page>
</ion-view>
Could be prototypal inheritance, I'm not sure how the scopes are connected. Anyway, you could use a $watch
$scope.$watch('objRef.count', function(newValue, oldValue) {
//update the DOM
});
If it's updated outside of the scope, you could use $apply
$scope.$apply(objRef.count = ?);