Angular Bootstrap 时间选择器未绑定时间

Angular Bootstrap Time Picker not Binding time

我无法像这样绑定我在控制器中设置的时间

 $scope.info.startTime="12:10:03";

这是我在 HTML

中的时间选择器控件
<span class="input-group">
          <input type="text" class="form-control" datepicker-popup="{{format}}"  tabindex="5"
                 ng-model="info.startTime" placeholder="hh:mm"
                 is-open="datepickerOpened1"
                 close-text="Close"/>
          <span class="input-group-btn">

            <button type="button" class="btn btn-default dropdown-toggle" ng-click="openStartTime($event, 'time')">
                <i class="glyphicon glyphicon-time"></i>
            </button>
                <div dropdown is-open="timepickerOpened1">
              <span class="dropdown-menu" role="menu">
                  <timepicker ng-model="info.startTime"  show-meridian="true"></timepicker>
              </span>
            </div>
          </span>
        </span>

参考:Angular Bootstrap

您需要在 ng-model 中设置日期对象而不是字符串。

改变

$scope.info.startTime="12:10:03";

var d = new Date();
d.setHours(12);
d.setMinutes(10);
$scope.info.startTime=d;