I'm creating an image gallery that loads a specific image if it is specified in the route (else loads the first):
foo/photos/sports/2
Each thumbnail is wrapped in a link to cause the address to change (so users can link back to it directly):
<ul class="gallery-thumbnails">
<li ng-repeat="piece in gallery.pieces">
<a ng-href="/foo/photos/sports/{{$index+1}}">
<img ng-src="{{piece.img}}" />
</a>
</li>
</ul>
The problem is that it causes the whole view to be re-rendered instead of just the template binded to the changed scope param (scope.gallery.selected
).
I can't find a way to cancel the view re-render (but I still want $routeParams to be updated).
I've seen solutions that listen for $locationChangeSuccess
, but that doesn't work for my scenario.