来自AngularJS示例的简单输入:
<body ng-controller="myappCtrl"> <form name="myForm"> <label>Enter your number:</label> <input type="number" name="myNumber" ng-model="name" min="{{minvalue}}" max="{{maxvalue}}"/> <pre>myForm.myNumber.$error = {{ myForm.myNumber.$error | json }}</pre> <pre>myForm.$valid = {{ myForm.$valid | json }}</pre> <div ng-messages="myForm.myNumber.$error" style="color:red"> <div ng-message="number">You did not enter a valid number</div> <div ng-message="min">Your field value is lesser minimum value</div> <div ng-message="max" translate="FORM.MAXVALUE"></div> </div> </form>
从
angular translate github:
原文链接:https://www.f2er.com/angularjs/240532.html这是多个范围的问题,你必须包装它.
<div ng-message="max"><span translate="FORM.MAXVALUE"></span></div>