<a href="#/assessments/{{assessment.id}}">
<div class="item item-divider">
<h2>{{assessment.test.name}}</h2>
<p>{{assessment.test.items.length}} questions</p>
</div>
<div class="item item-text-wrap item-icon-right">
{{assessment.test.introduction}}
<i class="icon-next icon"></i>
</div>
</a>
I need to pull through the id for each anchor that is created in a ng-repeat and then before it gets to the next state I need it to refresh the state instead of just loading the data. Is there a way to not do this in the controller?
You can try this:
<a ui-sref="assessments({id: assessment.id, reload: true})">
<div class="item item-divider">
<h2>{{assessment.test.name}}</h2>
<p>{{assessment.test.items.length}} questions</p>
</div>
<div class="item item-text-wrap item-icon-right">
{{assessment.test.introduction}}
<i class="icon-next icon"></i>
</div>
</a>
Then have this in your stateProvider:
.state('assessments', {
url: '/assessments/:id',
templateUrl: 'assessments.html',
controller: 'assessmentsController'
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With