Uib datepicker ng-change未在日期选择

时间:2016-07-22 15:14:07

标签: javascript angularjs datepicker angular-ui-bootstrap

我试图在更改uib datepicker中的日期时触发对函数的调用,但是ng-change属性似乎没有得到应用。我尝试过使用观察者,但由于我们在控制器中没有使用$ scope,因此我无法找到适合该方法的解决方案。请参阅以下代码:

<span class="input-group">
            <span class="input-group-btn">
              <button class="btn btn-default"
                      data-test="start-date-button"
                      ng-click="startDateIsOpen = !startDateIsOpen"
                      type="button">
                <i class="fa fa-calendar"></i>
                <span class="sr-only" translate>{{::'datePicker.openDatePicker'}}</span>
              </button>
            </span>
            <input class="form-control"
                   is-open="startDateIsOpen"
                   name="startDate"
                   ng-attr-aria-describedby="{{conditionsController.showError(conditionsController.newConditionAttributes, 'startDate') ?
                       'new-condition-start-date-errors' : undefined}}"
                   ng-change="conditionsController.setMinStartDate(conditionsController.newCondition.editCondition.startDate)"
                   ng-model="conditionsController.newCondition.editCondition.startDate"
                   ng-required="conditionsController.newCondition.editCondition.startTime"
                   popup-placement="top-left"
                   type="text"
                   uib-datepicker-popup="{{dateFormat}}"/>
          </span>

关于为什么这不起作用的任何想法?

0 个答案:

没有答案