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

ng-include rendering slowness #9559

Closed
meaganc opened this issue Oct 10, 2014 · 2 comments
Closed

ng-include rendering slowness #9559

meaganc opened this issue Oct 10, 2014 · 2 comments

Comments

@meaganc
Copy link

meaganc commented Oct 10, 2014

We have been using ng-include for partials in our new angular app, but we had to remove them because they were loading so slowly. This had significant visual impact on page load. Here's a great example of this issue:
http://plnkr.co/edit/dTUUPhsVrCbeSIjZzqmx?p=preview

How can we help address this? Is there something we're missing?

@btford btford self-assigned this Oct 10, 2014
@btford
Copy link
Contributor

btford commented Oct 10, 2014

you can inline the templates as part of your build process.

@btford btford added this to the Backlog milestone Oct 10, 2014
@Narretz
Copy link
Contributor

Narretz commented Jan 22, 2016

(Don't mind m, just cleaning old issues)
This is definitely faster in new versions (1.4 and beyond, approx 50% faster).
Inlining the templates is also a good idea, as it removes the async behavior.
If you only want to include so that you can structure your templates better, simply use a directive with a templateUrl. This is almost as fast as inlined templates, see http://plnkr.co/edit/5ChZjFBq2iPGJEaGHkZY?p=preview

Finally, if you have 5000 page elements, then you will almost always run into perf problems.

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

3 participants