How can I parse String to Int in an Angular expression?
I prefer to use an angular filter.
app.filter('num', function() {
return function(input) {
return parseInt(input, 10);
};
});
then you can use this in the dom:
{{'10'|num}}
Here is a fiddle.
Hope this helped!
You can try:
{{ 1 * num_str + 1 }}
http://jsfiddle.net/Z32fP/
In your controller:
$scope.num_str = parseInt(num_str, 10); // parseInt with radix