I want to make my web app stateless by saving some variables in the URL.
Currently, I am attempting to achieve this with the following code:
$AppService.setMyVar = function(myVar){
$state.params.myVar = myVar; //myVar = 1234
}
I expect the URL, which is set up as /contact?myVar=
, to change from /contact
to /contact?myVar=1234
How can I accomplish this in Angular? Additionally, is it possible to access variables set in the URL like this?
$AppService.getMyVar = function(){
return $state.params.myVar;
}