简体   繁体   English

Angular JS:刷新页面后,所有$ scope都会丢失,

[英]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 . 我正在尝试从孩子那里重新加载父级,但是,在午餐后重新加载链接后,我从链接中丢失了ID变量,从而造成了一个错误。 forexample instead of getting "Entity/account/Details/224563" i am getting Entity/account/Details/ and the code that i am using : 例如,而不是获取“ Entity / account / Details / 224563”,而是获取Entity / account / Details /和我使用的代码:

 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 我的问题是如何在不丢失id的情况下调用coreccly重新加载,只是想知道在我的情况下我需要重新加载“ $ state.go”将无法实现我的目标,并且我已经尝试过

$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});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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