html5 - ng-hide and ng-show with a counter angularJS -
i'm trying hide < li > , show angularjs. have counter when 0, displays 1 < li > , when 1 or higher, display < li >.
html
<li ng-hide="getdatosmiro.dataout({{contadormiro}} != 0)"><a ng-click="getalerts();$event.stoppropagation()" href="#"><img src="/neosanukcrmwebprofile/static/img/u1823.png" /></a> <span>miro cases <span class="exclamation">! <span class="badge" ng-controller="mirocontroler">{{contadormiro}}</span></span></span></li> <li ng-hide="getdatosmiro.dataout({{contadormiro}} == 0)"><a ng-click="getalerts();$event.stoppropagation()" href="#"><img src="/neosanukcrmwebprofile/static/img/u1823.png" /></a> <span style="color:#000;">miro cases </span></li>
angular
var app = angular.module('angularroutingapp'); app.controller('mirocontroler', ["$scope","getdatosmiro","getcrmcabecera",function($scope,getdatosmiro,getcrmcabecera) { $scope.inicializardatos=function() { $scope.contadormiro=0; var datain=getdatosmiro.datain; var dataout=getdatosmiro.dataout; if (getdatosmiro.dataout !=0) { alert('datos de entrada'); var total = getdatosmiro.dataout.numeroincidents * 1 + getdatosmiro.dataout.numerocompliants * 1 + getdatosmiro.dataout.numerodissatisfactions * 1; $scope.contadormiro=total; } else { alert('datos cero'); //$scope.contadormiro="-"; $scope.contadormiro=ng-show; } }; // leer datos de cabecera getdatosmiro.checkcompletion('getdatosmiro.done',$scope).then( function(event) { $scope.inicializardatos(); }); // }]);
in html change {{contadormiro}} total, change ng-hide ng-show , don't know have in angular.
can me please, thanx
you cannot use services in view, have use
$scope.getdatosmiro = getdatosmiro;
you don't need use {{}}
pass params, delete it
<li ng-hide="getdatosmiro.dataout(contadormiro) != 0)">
Comments
Post a Comment