Reload not working when passing multiple params in ui-router state

风格不统一 提交于 2019-12-11 06:02:46

问题


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?

来源:https://stackoverflow.com/questions/41757390/reload-not-working-when-passing-multiple-params-in-ui-router-state

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!