JSFiddle - React, Tailwind, and code Playground

by asimgeker

HTML

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<div ng-app>
  <div ng-controller="MyCtrl">
    <div ng-repeat="month in months" class="form-group">
      <ng-form name="myForm">
        <div class="col-sm-2">{{month.label}} : </div>
        <div class="col-sm-10">
          <input type="number" min="0" max="100" name="myName" ng-model="month.value" class="form-control" />
          <br />
        </div>
        <div style="color: red" ng-show="myForm.myName.$error.max">Should be less than 101</div>
        <div style="color: red" ng-show="myForm.myName.$error.min">Should be greater than -1</div>
      </ng-form>
    </div>
  </div>
</div>

JavaScript

function MyCtrl($scope) {
  $scope.months = [{
    label: 'January',
    value: 0
  }, {
    label: 'February',
    value: 1
  }];
}