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

Long $templateCache loading time in components with many inherit views. #12461

Closed
xmityaz opened this issue Jul 29, 2015 · 4 comments
Closed

Comments

@xmityaz
Copy link

xmityaz commented Jul 29, 2015

I have a page that has a lot of inheriting views.
For first time user redirecting to the page (views not in the cache) state is changing and user can see a loading spinner. All views are uploading from the server, even if ' ng-if="false" ' for them.
For next redirecting to the same page (views already in the cache) state is changing and there is delay about 2 seconds before user can see a spinner or any other reaction for his action.

Is there any workaround for this issue? To make $templateCache lazy loading, and load the view in case if ' ng-if="true" ' for example?

@realityking
Copy link
Contributor

Good timing, in #12078 they're working on a solution for this problem.

@Narretz
Copy link
Contributor

Narretz commented Aug 3, 2015

Are you loading the templates from the server via ajax? If so, you can try putting the templates inside the templateCache when you build your app, see e.g. https://github.com/karlgoldstein/grunt-html2js

@Narretz Narretz added this to the Ice Box milestone Aug 3, 2015
@xmityaz
Copy link
Author

xmityaz commented Aug 4, 2015

@Narretz I actually do the same with https://www.npmjs.com/package/grunt-angular-templates.
I'm loading templates via Ajax just for dev version

@Narretz
Copy link
Contributor

Narretz commented Jan 22, 2016

Looks like the lazy compilation of transcluded elements has fixed this.

@Narretz Narretz closed this as completed Jan 22, 2016
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