Hi i am trying to pass value to a input time tag, from javascript - angular JS.
Here is the following code.
JS :
$scope.from="09:00:00"
$scope.from="17:00:00"
HTML :
From : <input type="time" ng-model="from" >
To : <input type="time" ng-model="to" >
No value is getting updated inside input element. what is the mistake in above code?
Here is the Full code :
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
From: <input type="time" ng-model="fromTime"><br>
To: <input type="time" ng-model="toTime"><br>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.fromTime="09:00:00";
$scope.toTime="17:00:00";
});
</script>
</body>
</html>
Error: [ngModel:datefmt]
Copyright Notice:Content Author:「RohanSalins」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/56952041/how-to-pass-value-to-input-time-tag-using-ng-model