如何在ui-sref标记中添加重载选项

时间:2021-09-21 11:17:40

How can I specify the reload option in a ui-sref markup? All the examples I see use the javascript function directly.

如何在ui-sref标记中指定重新加载选项?我看到的所有示例都直接使用javascript函数。

<a ui-sref="app.editPost({new:true}, {reload:true})">new post</a>

Doesn't seem to work. Do I have to create a scope controller function to wrap that reload option instead?

似乎没有用。我是否必须创建范围控制器函数来包装该重新加载选项?

I've also tried some answers below and it doesn't seem to work with the Ionic framework. Link to code pen sample below:

我也在下面尝试了一些答案,它似乎不适用于Ionic框架。链接到下面的代码笔示例:

http://codepen.io/anon/pen/LERqeb

http://codepen.io/anon/pen/LERqeb

1 个解决方案

#1


62  

Here you go:

干得好:

<a ui-sref="app.editPost({new:true})" ui-sref-opts="{reload: true, notify: true}">new post</a>

http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.directive:ui-sref

http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.directive:ui-sref

#1


62  

Here you go:

干得好:

<a ui-sref="app.editPost({new:true})" ui-sref-opts="{reload: true, notify: true}">new post</a>

http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.directive:ui-sref

http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.directive:ui-sref