0

i"m tring to display error with ng-message when first value input time inferior value input second any any idea please ?

html

<input type="time" ng-model="mytime.morning"/> 

controller

$scope.mytime={};
$scope.mytime.morning=moment("06:00", ["h:mm"]).toDate();
ragnar
  • 1
  • 1
  • 3

1 Answers1

0

In order to compare two values you will need to have 2 values. Once you enter a new time the one the in initialized is gone, so i suggest making another variable to hold the other time...

Then you will have 2 values to compare against each other.

Sten Muchow
  • 6,623
  • 4
  • 36
  • 46