Kaushik Das Kaushik Das - 1 year ago 29
AngularJS Question

How to feed data in time tag from angular controller

I am using time field in html and want to feed data from angular controller

<input type="time" ng-model="bt_time" class="form-control" style="width: 20%" required>

I want to feed data from controller


But I am getting error

Error: [ngModel:datefmt] http://errors.angularjs.org/1.6.5/ngModel/datefmt?p0=12%3A30

Answer Source

Check this below code:

$scope.bt_time =  new Date(2017, 0, 1, 12, 30, 0);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download