Reputation: 872
I am using angular form builder and UI-Router. How can I set the reload option?
<a data-ui-sref="app.fbforms.newfbform"
data-ui-sref-opts="{cache: false,reload:true}">NewForm</a>
not working reload option.. page not properly load
Upvotes: 0
Views: 2382
Reputation: 123901
There is a working plunker. The link defined as above is working AS IS. The issue must be elsewhere.
So, to prove it, I created these states:
.state('app', {
url: '/app',
template: '<div ui-view></div>',
})
.state('app.fbforms', {
url: '/fbforms',
template: '<div ui-view></div>',
})
.state('app.fbforms.newfbform', {
url: "/newfbform",
templateUrl: 'tpl.html',
controller: 'newfbformCtrl',
})
and this controller
.controller('newfbformCtrl', ['$scope', function ($scope) {
$scope.now = new Date();
}])
And this call is working as expected:
<a data-ui-sref="app.fbforms.newfbform"
data-ui-sref-opts="{cache: false,reload:true}">
And changes this view on every click:
<div>
changes on reload: {{now}}
</div>
Check it here
Upvotes: 2