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

Cache template linkers instead of template strings #866

Closed
kseamon opened this issue Apr 9, 2012 · 3 comments
Closed

Cache template linkers instead of template strings #866

kseamon opened this issue Apr 9, 2012 · 3 comments

Comments

@kseamon
Copy link
Contributor

kseamon commented Apr 9, 2012

Currently, ng:include, ng:view, and directives with templates cache their template strings for future use.

It would probably be better if they instead compiled the template string once then cached the resulting linker.

(just an idea - no hurry)

@IgorMinar
Copy link
Contributor

We should explore this in the future. The idea was on the table when I was
writing this code, but there was a concern about increased memory usage so
we decided to punt on it for now.

@jimmywarting
Copy link
Contributor

another thing that comes to mind is when http interceptor change the response dynamically
and that might be an reson not to cache the compiled template

response: function(res){
   res.data.replace("<now />", '<time datetime="'+ (new Date).toJSON() +'">Today</time>');
   return res;
}

But perhaps caching the compiled template is a good thing for a example ng:repeater?

@IgorMinar
Copy link
Contributor

we will do this and more in v2 but I don't see us changing the current behavior in v1.

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