Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Please add an option for not re-rendering ng-view or ng-include #3825

Closed
e-oz opened this issue Aug 31, 2013 · 8 comments
Closed

Please add an option for not re-rendering ng-view or ng-include #3825

e-oz opened this issue Aug 31, 2013 · 8 comments

Comments

@e-oz
Copy link

e-oz commented Aug 31, 2013

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.

@jankuca
Copy link
Contributor

jankuca commented Sep 3, 2013

Got a demo?

@e-oz
Copy link
Author

e-oz commented Sep 3, 2013

Any page with tabs can be a demo for this FR, when each tab is separate view. And it's not rare case.

@colthreepv
Copy link

angular.js base works using a single view per URL.

A more structured solution can be achieved using this project: angular-ui-router

@e-oz
Copy link
Author

e-oz commented Sep 5, 2013

@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:

  1. "a de-facto solution to nested views and routing"
  2. "It is not recommended to use this library on projects that require guaranteed stability"

@btford
Copy link
Contributor

btford commented Dec 19, 2013

I don't understand. Can you please provide a demo (via jsfiddle or the like) showing the current behavior versus the desired behavior?

@e-oz
Copy link
Author

e-oz commented Jan 17, 2014

Sorry for so long reply, @btford
http://plnkr.co/edit/0JpK6R8X7SeOJmLXaPHR?p=preview

@btford
Copy link
Contributor

btford commented Mar 25, 2014

I suspect what you want to be able to do is debounce the route change until after some certain point to avoid rerendering.

@btford btford added this to the Backlog milestone Mar 25, 2014
@btford btford removed the gh: issue label Aug 20, 2014
@Narretz
Copy link
Contributor

Narretz commented Apr 21, 2017

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.

@Narretz Narretz closed this as completed Apr 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants