I am using the state in Angular Js. I want to add some field like date in url without reloading the state. So I have seen related link AngularJS UI Router - change url without reloading state But I am still stuck in this problem.
HTML
<button class="btn btn-md btn-primary" ng-click="dumy()">Apply</button>
CONTROLLER
$scope.dumy=function(){
$scope.startDate="2017-07-26T09:30:00Z";
$scope.endDate="2017-07-26T18:30:00Z";
}
MODEL.JS
.state('app.shine', {
url: '/showData',
params:{
View:null,
Edit:null,
Enable:null,
Delete:null
},
views: {
"content@app": {
templateUrl: 'view/view.html',
controller: 'controller'
}
},
})
I want to set $scope.startDate value in the URL as a state or query parameter. If I reload the page then These parameter should be there in URL , But these parameter should be set after click on the Apply button. I am new in the angular js. Please share your ideas. Thanks in advance.