Is there a way to take form input numbers in this format within $scope:
From:
<input type="text" ng-model="form.octHours">
Which renders:
"form.octHours": "12"
And convert the format to numeric where controller data looks like this:
{
data: [12]
}
Which will be used in the controller like this:
$scope.form = {};
$scope.data = {
datasets:[
data: [$scope.form.octHours]
]
}
I have tried using input type="numeric" and escaping the quotes via javascript, but is there an elegant way of doing this? Thank you...
Have you tried injecting a filter into the controller then doing a string to it conversion?
$scope.items = $filter('filter')($scope.items2, val);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With