<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Example - example-month-input-directive-jquery</title>
  

  <script src="../../components/jquery-3.2.1/jquery.js"></script>
  <script src="../../../angular.js"></script>
  

  
</head>
<body ng-app="monthExample">
  <script>
 angular.module('monthExample', [])
   .controller('DateController', ['$scope', function($scope) {
     $scope.example = {
       value: new Date(2013, 9, 1)
     };
   }]);
</script>
<form name="myForm" ng-controller="DateController as dateCtrl">
  <label for="exampleInput">Pick a month in 2013:</label>
  <input id="exampleInput" type="month" name="input" ng-model="example.value"
     placeholder="yyyy-MM" min="2013-01" max="2013-12" required />
  <div role="alert">
    <span class="error" ng-show="myForm.input.$error.required">
       Required!</span>
    <span class="error" ng-show="myForm.input.$error.month">
       Not a valid month!</span>
  </div>
  <tt>value = {{example.value | date: "yyyy-MM"}}</tt><br/>
  <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
  <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
  <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
  <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
</form>
</body>
</html>