Hello, I have the following function:
$scope.calcularTotal = function(startDate, endDate){
$scope.items = $filter('betweenDate')($scope.items, 'dataPagamento', startDate, endDate);
console.log("testee: "+$scope.items)
var total = 0;
var glosa = 0;
var lote = 0;
angular.forEach($scope.items, function(item) {
total += (item.totalLiquido);
glosa +=(item.totalGlosa);
lote +=(item.totalLote);
});
$scope.totalLiquido = total;
$scope.totalGlosa = glosa;
$scope.totalLote = lote;
console.log("Total Liquido: "+$scope.totalLiquido)
console.log("Total Glosa: "+ $scope.totalGlosa)
console.log("Total Lote: "+$scope.totalLote)
$state.go('tabs.facts', {}, {reload: true});
}
This function is called from a button:
<button class="button icon icon-right ion-chevron-right" ng-click="totais(startDate, endDate)" style="width:100%">Visualizar Totais</button>
In console.log I get the result, but the result does not appear on my page:
This is my page:
<ion-view title="Totais" cache-view="false">
<ion-content has-header="true" padding="true">
<h3 style="text-align:center">Total</h3>
<p style="margin-top:30px;font-weight:bold;color: #0066FF">Total Lote: {{totalLiquido}}</p>
<p style="font-weight:bold;color: #990000">Total Glosa: {{totalGlosa | currency}}</p>
<p style="font-weight:bold;color: #339900">Total LĂquido: {{totalLiquido | currency}}</p>
</br>
</br>
</br>
</br>
<p>
<a class="button icon ion-home" href="#/tab/home" style="width:100%"> Home</a>
</p>
</ion-content>
</ion-view>
What could be wrong?