0
I created a list where I need to show whether an item has already been read or not, so I check a variable with the ng-if directive. But when the item is opened, and then returns/browses back to the list, there is no change in the list. I noticed that the variable being checked with ng-if is having its value changed, but ng-if does not reevaluate when the view is shown again. ng-if only works when the screen is loaded/reloaded, ie when close and open the app again.
How could you get around this problem?
<ion-item collection-repeat="item in items"
ng-click="ctrl.marcaLida(item.id)"
ui-sref="menu.telaLeitura({idItem:item.id})">
<p ng-if="!item.lido_em">o</p>
{{item.nome}}
</ion-item>
</ion-list>
I’m using router for navigation.
The value is being changed as it is possible to print in the list. It was the first check I did. They come by default
null
and after an item is opened, it comes with the value2015-08-19 15:33:20
which is the date and time the item was opened.– Tiago Amaral
Sends the controller code to jsfiddle before p puts {{item.lido_em}} and checks what comes back when you change view and when you reload the page
– Thiago Frias