如何在ui-sref标记中放置重新加载选项

问题描述 投票:27回答:1

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

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

似乎没有用。我是否必须创建一个范围控制器函数来包装该reload选项?

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

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

javascript angularjs ionic-framework angular-ui-router
1个回答
70
投票

使用ui-sref-opts。您去了:

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

https://ui-router.github.io/ng1/docs/0.3.1/index.html#/api/ui.router.state.directive:ui-sref

© www.soinside.com 2019 - 2024. All rights reserved.