angular-tooltips icon indicating copy to clipboard operation
angular-tooltips copied to clipboard

Angular Template cache is now supported

Open slavafomin opened this issue 8 years ago • 5 comments

I've implemented support for Angular template cache. Now, the module first tries to load specified template from cache and then falls back to $http.get. When template is actually loaded from server it is saved in the cache for further use. This is the expected behavior for any Angular module that uses templates.

slavafomin avatar Apr 19 '16 10:04 slavafomin

It fixes #151.

slavafomin avatar Apr 19 '16 10:04 slavafomin

Hi @slavafomin thanks for your time, as described in https://github.com/720kb/angular-tooltips/pull/150 to merge a templateCache feature it has to be an option that you can toggle via attribute.

tooltip-template-cache="true" and it caches the template you pass through 👍

45kb avatar Apr 19 '16 11:04 45kb

Hey @45kb! Why do you want it to be optional? Angular itself and many other popular modules are using template cache automatically, without the any opt-ins. If user don't want to use template cache he just could skip adding anything to it. If you're concerned about $templateCache.put that I call, we could omit this line or make it optional.

slavafomin avatar Apr 19 '16 13:04 slavafomin

@slavafomin i can agree with you but the real correct way is simple, set an attribute, if the attribute is present or true, you store and retrieve the template in and from the cache, otherwise you don't have to interact with cache.

It's not my own view or choice, it's how we should release features to make everyone happy and for any possible use case, i hope you'll understand.

45kb avatar Apr 19 '16 14:04 45kb

Then be sure to look, there is a tooltipConfProvider somewhere which must be updated the same ;)

https://github.com/720kb/angular-tooltips#globals

45kb avatar Apr 19 '16 14:04 45kb