-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Please add an option for not re-rendering ng-view or ng-include #3825
Comments
Got a demo? |
Any page with tabs can be a demo for this FR, when each tab is separate view. And it's not rare case. |
angular.js base works using a single view per URL. A more structured solution can be achieved using this project: angular-ui-router |
@MrGamer "angular.js base works using a single view per URL" - and I don't ask for anything else in this issue. This issue is NOT about nested routing. I've tried angular-ui-router and that project doesn't solve this issue - views re-rendering happens on each change of route (in hash tag). Also, these two lines in description of project are controversial:
|
I don't understand. Can you please provide a demo (via jsfiddle or the like) showing the current behavior versus the desired behavior? |
Sorry for so long reply, @btford |
I suspect what you want to be able to do is debounce the route change until after some certain point to avoid rerendering. |
AngularJS ngRoute doesn't cache html or data. It's not as easy as keeping the ngView / ngInclude html around, you'd need to keep the scopes, the controllers etc. Aggressive caching can also impact performance, as this is kept in memory. I don't see a chance for this at this point - the best bet is to cache the view / include data when the route / scope changes, and restore it when it switches back. |
Please make it possible to disable views re-rendering on each change of ng-include src at least (if it's not possible for ng-view). Otherwise for tabs I have to put content of ALL views (huge views) in one page. Please, don't just close this issue, it's a very very important thing for me and (I think) for some other users.
The text was updated successfully, but these errors were encountered: