javascript - Change URL dynamically depending on datepicker's value angular.js -


<label>from</label> <input type="text" datepicker-popup="dd-mm-yyyy" ng-model="startdate"/> <label>to</label> <input type="text" datepicker-popup="dd-mm-yyyy" ng-model="enddate"/>    

the url route :

get /admin/api/stats controllers.adminstatsapi.get(start: option[localdate], end: option[localdate], computediff: boolean ?= false)

my question how can change url depending on date (value) entered in datepicker.

you have given insufficient information. use? ui-router? $location?

but can that:

var changeurl = function(startdate, enddate){   //do url change whatever thing using change url }  $scope.$watch('startdate', function(newvalue){    var start = newvalue;    var end = $scope.enddate;     //do url change here    changeurl(start, end); }, true);   $scope.$watch('enddate', function(newvalue){    var start = $scope.startdate;    var end = newvalue;     //do url change here    changeurl(start, end); }, true); 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -