How to put reload option in ui-sref markup

时光怂恿深爱的人放手 提交于 2019-12-17 16:27:20

问题


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

<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:

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


回答1:


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



来源:https://stackoverflow.com/questions/27690834/how-to-put-reload-option-in-ui-sref-markup

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