In AngularJS, how can we set the min attribute of input type=\"date\" to current date (today\'s) ?
According to the Angular docs
min (optional) string Sets the min validation error key if the value entered is less than min. This must be a valid ISO date string (yyyy-MM-dd).
you can bind that to a scope variable or directly put the expression in the attribute, it just needs to be in the correct format (javascript date object has a toISOString() method). It should also be noted this does not prevent the user from picking a date below the minimum and instead sets the validation key to indicate the field is not valid.
edit:
Script
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
$scope.name = 'World';
var today=new Date();
$scope.today = today.toISOString();
});
Html
AngularJS Plunker
Hello {{name}}!
your error message indicates you want the date to be no greater than the current date, if that is the case simply change
to
Working Example