簡體   English   中英

如何在 html 5 日期選擇器輸入類型中單擊日期時調用 function

[英]How to call a function on click of date in html 5 datepicker input type

我有一個 html5 日期時間選擇器。現在在從日期選擇器中單擊鼠標(選擇)日期時,我想調用 function。我想知道我們如何在 ZD18B8624A0F5F721DA7B82365FC5 中做到這一點......

html:

 <div class="col-lg-4">
 <input class="form-control" type="datetime" date-time auto-close="true" view="date" 
  min-view="date" format="dd/MM/yyyy" ng-model="$root.Details.date" value = "{{dob}}">
 </div>

JS

class CreateCustomerCtrl {
constructor($scope,$rootScope,$http,$state,$reactive,$timeout,Notification)
{

//logic here
}
export default angular.module('createCustomer', [
angularMeteor
])
.component('newCustomer', {
templateUrl: 'client/customer/new-customer.html',
 controller:['$scope','$rootScope','$http','$state','$reactive','$timeout','Notification'
,customerCtrl]});

因此,在日期的 select 上,我想調用 function。 謝謝在此處輸入圖像描述

你應該試試<input type="date" onchange="return function(this) />;" return您的 function 做任何您想做的事情。

您可以在輸入時使用ng-change="yourFunc()"事件,並使用ng-model="myDate"綁定值,並在內部函數中放置邏輯。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM