Simple input from an AngularJS example:
<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>
link to plnkr
When you enter a value higher than 5 a translated error message should be visible. It does not work when I use the translate directive.
From the angular translate github:
That's an issue with multiple scopes, you have to wrap it.
<div ng-message="max"><span translate="FORM.MAXVALUE"></span></div>
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