Set min date to current date in angularJS input

前端 未结 5 800
梦如初夏
梦如初夏 2020-12-30 02:59

In AngularJS, how can we set the min attribute of input type=\"date\" to current date (today\'s) ?



        
5条回答
  •  被撕碎了的回忆
    2020-12-30 03:31

    just add in your controller

    $scope.today=new Date() // calculates current date
    

    and in your html code add -

    min-date="today"
    

提交回复
热议问题