I have an situation on my page.
I have two inputs and an label in my page. These label have to show the sum of these two inputs value.
So I tried below sol
Have you actually created a parseFloat
method in your controller? Because you can't simply use JS in Angular expressions, see Angular Expressions vs. JS Expressions.
function controller($scope)
{
$scope.parseFloat = function(value)
{
return parseFloat(value);
}
}
edit: it should also be possible to simply set a reference to the original function:
$scope.parseFloat = parseFloat;
I would also expect it to work with filters, but unfortunately it doesn't (might be a bug, or i've misunderstood how filters work):
A workaround would be to use multiplication for casting: