I am using ui-router with parent and child states. My states are defined as below :
.state("home.ben", {
url: "/beneficiary/:name",
abstract:true,
templateUrl: "app/ben/views/ben-form.html",
controller: "BeneficiaryFormController",
controllerAs: "bfCtrl",
params : {id:'',name:''},...
.state("home.ben.general", {
url: "/",
templateUrl: "app/ben/views/partials/general.html",
controller: "BeneficiaryGeneralController",
controllerAs: "bGenCtrl",
params:{id:'',name:''},
ncyBreadcrumb: {
label:"General",
skip: true
},
resolve: {...
I am routing to the state using ui-sref = "home.ben.general({id:someID,name:someName})"
or $state.go("home.ben.general",{id:someId,name:someName})
.
Everything is working fine except that when I refresh the page the view does not load. I think the id
param is not getting passed when the view reloads.
Any suggestions on how to get this working so that it works even when someone hits 'F5' or refreshes the page?