I want to maintain state of user-data. So that even on reload I can show the exact result to user using stateParams
but without showing in URL(query string) in browser. How can I achieve this?
Asked
Active
Viewed 2,098 times
0

Partha Sarathi Ghosh
- 10,936
- 20
- 59
- 84

codehungry
- 3
- 3
1 Answers
0
var app = angular.module('rootApp', [
'ui.router'
]);
pp.config(function ($stateProvider, $urlRouterProvider, $locationProvider, $httpProvider) {
$urlRouterProvider.otherwise('/signin');
$stateProvider
.state('user', {
url: '/home',
params: {
guid: null,
role: NaN
},
templateUrl: 'Components/default/home.html',
controller: 'rootCtrl',
data: {
requireLogin: true
}
})
});
now you can navigate to this state from href tag like:
<a ui-sref="user({guid: 1, role: 'anyrole'})">
or by method :
$state.go('user', {param: {guid: 1, role: 'anyrole'}});

Sheelpriy
- 1,675
- 17
- 28
-
thanks , hope it will work. – codehungry Dec 23 '15 at 08:47