0
我有一個Angular指令,其中包含一個帶日期選擇器的表單。我正在嘗試創建一個函數來保持單擊按鈕從調用窗體上提交。我無法確定在哪裏找到.opened屬性。當我用ng執行打開時,單擊所有工作。以下是示例代碼。Angular指令打開日期選擇器
HTML:
<form ng-submit="editAlert.$valid && vm.handleSubmit()" name="editAlert" id="editAlert" class="buffer-bottom" novalidate>
<div class="form-group">
<label class="control-label" for="effectiveDate">Effective Date</label>
<div class="input-group">
<input type="text" class="form-control" uib-datepicker-popup="MM-dd-yyyy" is-open="dpEffectiveDate.opened" ng-model="alertMsg.effectiveDateFmt" name="effectiveDate" id="effectiveDate">
<span class="input-group-btn">
<button class="btn btn-default" ng-click="vm.openDateHandler($event)"><i class="fa fa-calendar"></i></button>
</span>
</div>
<p class="help-block" ng-show="editAlert.effectiveDate.$error.endBeforeStart">Effective date must be before expire date.</p>
</div>
</form>
我也試過路過dpEffectiveDate到openDateHandler功能。
下面是我的打字稿功能
openDateHandler = ($event) => {
$event.preventDefault();
//dpDate.opened = !dpDate.opened;
}
如何訪問年開業屬性?