选项卡内的Angular-UI Bootstrap Datepicker,其中ng-required属性不起作用

时间:2014-10-23 09:26:26

标签: angular-ui angular-ui-bootstrap

我正在尝试让Bootstrap日期选择器在选项卡下工作,看起来它与使用ng-required属性的一些问题。它不会更新模型值。看起来像一个bug但不确定。如果你拿出ng-required属性,一切都会正常工作。

任何帮助都会有所帮助。 plunker:http://plnkr.co/edit/NFcm0Bpu0y45LsrzVtpr?p=preview

 $scope.data = { 
      opened: false, 
      record: 
      { 
        "Date of Birth": "2005-10-29T00:00:00" 
      } 

<form name="mainForm" novalidate>
            <div class="container" ng-form="subForm">
                <tabset>
                    <tab>
                        <div class="row">
                            <div class="col-sm-3">
                                <div class="form-group" ng-class="{'has-error': subForm['test'].$invalid}">
                                    <label class="control-label">Date of Birth</label>
                                    <p class="input-group">
                                        <input type="text" name="test" class="form-control" datepicker-popup="dd-MMM-yyyy" ng-model="data.record['Date of Birth']" is-open="data.opened" datepicker-options="dateOptions" close-text="Close" ng-required="true" />
                                        <span class="input-group-btn">
                                            <button type="button" class="btn btn-default" ng-disabled="false" ng-click="openDate($event)"><i class="glyphicon glyphicon-calendar"></i></button>
                                        </span>
                                    </p>
                                </div>
                            </div>
                        </div>
                    </tab>
                </tabset>
            </div>
    </form>

1 个答案:

答案 0 :(得分:0)

它正在使用Angular 1.2.16。问题是与Angular 1.3.0一起使用时。记录了Angular-ui的一个问题。