<commit_before># myApp/assets/templates
### Purpose - Client-side Templates

Client-side HTML templates are important prerequisites for certain types of modern, rich client applications built for browsers; particularly [SPAs](https://en.wikipedia.org/wiki/Single-page_application). Whether or not you use this sort of template in your app and how you structure your templates is, of course, completely up to you.  But for the sake of convention, new apps generated with Sails include a `templates/` folder for you by default.

To work their magic, frameworks like Backbone, Angular, Ember, and Knockout require
that you load these templates client-side.

By default, your Gruntfile is configured to automatically load and precompile
client-side JST templates in your `assets/templates` folder, then
include them here automatically (between TEMPLATES and TEMPLATES END).

    <!--TEMPLATES-->
        
    <!--TEMPLATES END-->

To customize this behavior to fit your needs, just edit your Gruntfile.
For example, here are a few things you could do:

- Import templates from other directories
- Use a different template engine (handlebars, jade, dust, etc) 
- Internationalize your client-side templates using a server-side stringfile before they're served.


<docmeta name="displayName" value="templates">
<commit_msg>Update _templates.md<commit_after># myApp/assets/templates
### Purpose - Client-side Templates

Client-side HTML templates are important prerequisites for certain types of modern, rich client applications built for browsers; particularly [SPAs](https://en.wikipedia.org/wiki/Single-page_application). To work their magic, frameworks like Backbone, Angular, Ember, and Knockout require that you load templates client-side; completely separate from your traditional [server-side views](http://sailsjs.org/documentation/concepts/views).  Out of the box, new Sails apps support the best of both worlds.

Whether or not you use client-side templates in your app and where you put them is, of course, completely up to you.  But for the sake of convention, new apps generated with Sails include a `templates/` folder for you by default.


### How do I use these templates?

By default, your Gruntfile is configured to automatically load and precompile
client-side JST templates in your `assets/templates` folder, then
include them in your `layout.ejs` view automatically (between TEMPLATES and TEMPLATES END).  

    <!--TEMPLATES-->
        
    <!--TEMPLATES END-->

This exposes your HTML templates as precompiled functions on `window.JST` for use from your client-side JavaScript. 

To customize this behavior to fit your needs, just edit your Gruntfile.
For example, here are a few things you could do:

- Import templates from other directories
- Use a different template engine (handlebars, jade, dust, etc) 
- Internationalize your client-side templates using a server-side stringfile before they're served.


For more information, check out the conceptual documentation on [Sails' asset pipeline](http://preview.sailsjs.org/documentation/concepts/assets).

<docmeta name="displayName" value="templates">

{'fraction_non_alphanumeric': 0.07044508485430676, 'fraction_numerical': 0.0, 'mean_word_length': 4.618705035971223, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6336005', 'n_tokens_mistral': 803, 'n_tokens_neox': 756, 'n_words': 388}