bs-timepicker没有默认值

时间:2015-10-27 02:10:49

标签: angularjs django twitter-bootstrap-3

这是我的时间选择器,但它没有显示dafault值。我是angularjs或bootstrap的新手。我非常感谢你的帮助。

<script type="text/javascript" charset="utf-8">
    angular.module('myProject').controller('Timepicker_{{ field.id_for_label }}', function($scope) {
            $scope.selectedTime = new Date("{{ field.value }}");
    });
</script>


<div class="form-group"
     ng-controller="Timepicker_{{ field.id_for_label }}">
     <label for="{{ field.id_for_label }}" class="col-sm-2 control-label">{{ field.label_tag }}</label>
    <div class="col-sm-3">
        {{ field.errors }}
        <input type="text"
               class="form-control"
               ng-model="selectedTime"
               data-time-format="HH:mm"
               data-length="1"
               bs-timepicker
               data-autoclose="1"
               name="{{ field.name }}"
               >
    </div>
</div>

但是当我删除bs-timepicker时,它会显示默认值selectedTime,但时间戳不会起作用

0 个答案:

没有答案