简体   繁体   中英

Angular JS: all $scope is lost after refreshing the page,

I am trying to reload the parent from the child,however after lunching the reload link i am loosing the id variable from the link wich make a bug . forexample instead of getting "Entity/account/Details/224563" i am getting Entity/account/Details/ and the code that i am using :

 var accountstate = $myapp.findOverviewInjector().get("$state");
 var idEntity= parseInt($state.params.entityId);
 personstate.reload(accountstate.current, {id:idEntity}, { reload: true });

for extra details:

controller:"AccountDetailsCtrl"
name:"details"
params:{entity:"Acount"}
url:"/Entity/:entity/Details/:id?ids"

my question is how to call reload coreccly without loosing the id just to know in my case i need reload "$state.go" will not achieve my goal and i try it already like

$state.go(accountstate.current, { id: $state.params.entityId }, { reload: accountstate.current });

it work but it does not achive the goal

big thanks in advance

解决方案是$ state.go(accountstate.current.current,{id:$ state.params.entityId},{reload:true});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM