I have JSON file with a list of strings that contain numbers, e.g
{
"MyAccount": "105"
}
On the front end, can i perform a condition on this value? ie:
<div ng-if="MyAccount > 100">
//code ig account greater than 100
</div>
Trying to do this without having to write any JS as this ng-if will be within a complex ng-repeat
Ive tried:
<div ng-if="parseInt(MyAccount) > 100">
//code ig account greater than 100
</div>
<div ng-if="MyAccount > 100">
this should work since javascript can evaluate something like ("6" > 5)
to true.
somehow,
you can try something like this,
<div ng-if="myfunc(MyAccount)">
in the controller,
$scope.myfunc = function(myAcc) {
var intValue = parseInt(myAcc);
if(intValue > 100) {
return true;
} else {
return false;
}
}