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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -