pitr / angular-rails-templates

Use your angular templates with rails' asset pipeline
https://rubygems.org/gems/angular-rails-templates
MIT License
566 stars 169 forks source link

Question : Does this gem download the whole application on load? #128

Closed real-ashwin closed 8 years ago

real-ashwin commented 8 years ago

Since angular-rails-templates adds all js and html to the $templateCache, doesnt the whole application get downloaded to the client side on load? So, is this recommended only for small applications or have I understood it wrong?

pitr commented 8 years ago

You are correct! :) Instead of the default behaviour of trying to download templates when your app need to use them to render pages, this gem converts your HTML templates to javascript and pre-populates your template cache with them, requiring zero requests. This is recommended for both small and (especially) large applications. The more templates you have, the more you benefit from not making additional AJAX requests.

PS this gem deals only with templates. All your application JS should already be downloading on load, thanks to Rails asset pipeline :wink: