javascript - return value from datepickerCallback function -
i new angular js, , application using datepickercallback function date selected. how can return value of function ? want date selected , pass in http request data corresponding date.
self.datepickercallbackfrom = function(val) { if (typeof(val) === 'undefined') { console.log('date not selected'); } else { console.log('selected date : ', val); self.datefrom = val; } };
html:
<ionic-datepicker date="exctrl.datefrom" disablepreviousdates="false" disablefuturedates="true" callback="exctrl.datepickercallbackfrom" title="exctrl.titlefrom">
it looks have pass callback option not html attribute.
https://github.com/rajeshwarpatlolla/ionic-datepicker#readme
var options = { callback: function (val) { //mandatory if(typeof(val) === 'undefined') { console.log('date not selected'); } else { console.log('selected date : ', val); self.datefrom = val; } } }; $scope.opendatepicker = function(){ ionicdatepicker.opendatepicker(options); };
Comments
Post a Comment