<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>NG Numbers Only - Input number with digit issue fixed</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script>
<script src="https://rawgit.com/willmendesneto/ng-numbers-only/master/dist/ng-numbers-only.js"></script>
<script src="app.js"></script>
</head>
<body ng-app="ngNumbersOnly">
<table>
<tr>
<td>Without precision</td>
</tr>
<tr ng-repeat="x in [0, 1]">
<td>
<input type="number" ng-model="x" min="0" /> {{ x }} : {{ typeOf(x) }}
</td>
</tr>
<tr>
<td>With precision</td>
</tr>
<tr ng-repeat="model in [{value: 0.5, precision: 2}, {value: 1, precision: 3}]">
<td>
<input type="number" numbers-only precision="{{::model.precision}}" ng-model="model.value" step="0.10" min="0" /> {{ model.value }} : {{ typeOf(model.value) }}
</td>
</tr>
</table>
</body>
</html>
<!--
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
-->
(function(angular) {
'use strict';
angular.module('ngNumbersOnly', ['keepr.ngNumbersOnly'])
.run(function($rootScope) {
$rootScope.typeOf = function(value) {
return typeof value;
};
});
})(window.angular);
/*
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
*/