2016-12-15 89 views
0

我有一个html5日期时间选择器。现在从鼠标点击(选择)日期选择器的日期我想调用一个函数。我想知道我们怎么能做角js ...可以 有人帮助我。如何在html5 datepicker输入类型中点击日期时调用函数

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]}); 

所以在选择日期我要调用一个函数。 感谢 enter image description here

回答

0

你可以使用输入ng-change="yourFunc()"事件与ng-model="myDate"结合价值和功能里面,你可以把你的逻辑。

+0

试过这个,但did not working.FUNction没有被称为 –

+0

$ scope.yourFunc =函数(){ } 你试过吗? –

+0

对不起,我试过这个,没有工作,功能没有被称为 –