Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
21
rated 0 times [  22] [ 1]  / answers: 1 / hits: 27573  / 10 Years ago, mon, december 29, 2014, 12:00:00

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


More From » angularjs

 Answers
72

Use ui-sref-opts. Here you go:



<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


[#68363] Wednesday, December 24, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
deving

Total Points: 26
Total Questions: 94
Total Answers: 103

Location: Serbia
Member since Tue, Jul 26, 2022
2 Years ago
;