I would like to use the ngShow AngularJS directive inside of the ionic view-title attribute, but it is not working.
Here is my code:
<ion-view view-title="List of Activities<span ng-show='!isEmpty(listAvtivitiesToUpdate.length)' class='item-note'>{{listAvtivitiesToUpdate.length}} queued</span>" direction="y">
isEmpty is a function declared in my rootScope, it’s working in other places but not here.
I also tried this code, just to try, but still without luck:
The span element is working, only the ng-show is not working.
What I would like to do is show in the header the number of elements queued only when we got at least one element.
You could also use ionNavTitle which allows you to replace the title text with html.
<ion-view direction="y">
<ion-nav-title>
List of Activities<span ng-show='!isEmpty(listAvtivitiesToUpdate.length)' class='item-note'>{{listAvtivitiesToUpdate.length}} queued</span>
</ion-nav-title>
I ran across this tonight (with tab titles). Elements inside of the title tag work, but ng-show is just sanitized out it seems. For instance, I want to have a title that has an error icon in it:
The icon will always appear because ng-hide is stripped out (but the classes and element aren’t). I overcame this by using css to hide the icon when I needed to