Question

Given the pop-up example at http://plnkr.co/edit/idrirF9zxvCMCQWTk8nr?p=preview how do I actually get the date if the user changes it?

I am guessing that I should do it in $scope.open = function($event) but I just don't know how. I have searched this site & googled extensively. What did I miss? Thanks.

Was it helpful?

Solution

you plunk link is not working. I don't know what exactly happen in your code.

I think maybe your miss ng-model, ng-model is the way to do two-way data binding in angular .

for example

<input type="text" datepicker-popup="dd-MMMM-yyyy" ng-model="dt" />

in this example date is binding to dt (ng-model="dt")

you can get data by $scope.dt if you want to watch the date change you can do

$scope.$watch('dt',function(val){
   //to do       
   console.log(val)
})
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top