I have an input field that binds to product price which has 2 decimal precisions:
<input type="number" name="price" step=".01" id="price" ng-model="product.price" min="0" max="1000000" required>
I then ng-submit this product and get response from the server, updated the product.price from what's echo'ed from server, but the above price input becomes empty, now from
console.log($scope.product.price)
I can tell that this value from server is a string now, but then even if I do the follows:
$scope.product.price = parseFloat(response.updatedModel.price).toFixed(2);
the price input is still empty.... how can I make this price input show that price value in 2 decimal precisions echo'ed from server?
.toFixed(2);:$scope.product.price = parseFloat(response.updatedModel.price);