angularjs - Preload ng-view for smoother navigation -


I'm using $ location.path () to load new views inside my angular web site. My page looks like this:

  & lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; div data-ng-view = "" & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

And I change the NG-view based on demand (index, home, login, etc.). Navigation slow down some time (there is something wrong on the page, while 0.1 seconds) is there a way to create navigation immediately?

In addition, I tried to nig-animate which improves this feeling but not completely. I think it would be a solution to pre-load my thoughts'.

Edit:

Adding correction:

  myApp.run (function ($ template cache, $ http) {$ http.get ( 'Template1.html', {cache: $ templateCache}}};    

To manage the states and views, you can use a better library.

In order to pre-load each resource, it is necessary in your nested state to avoid flickering of the property Via), before you get to the interface Avoid lingering, but you can load each resource that you personally want, you have shown your view if you do not want to refactor your app to use the U-Router (which I More manageable), you may be stuck in using $ template cache and managing your thoughts resources manually

A move that you have to do Can shish would require to load after load resources your view controller. Apart from this, maybe you see some parts of your app repeating, try removing them in a different template and if you can, then use them again. If you can divide your app in such a way that every time you change the scene, it is not re-presented every time, perhaps it will have a beneficial impact on the speed.

Comments

Popular posts from this blog

c++ - ERROR: cannot open source file x11\xlib.h -

c - What are pthread cancelation points used for? -

c# - Show a huge number of data in DevExpress GridView -