2. Agenda
External Templates
View Paths
Expressions
Registering Custom Tags
Converters
Helper Functions and Template Parameters
Helper Functions for Unique Scenarios
Which to Use?
Allow code
2 2012/05/18
3. External Templates
Code reuse is one of the big advantages of using
templates
Templates that should accessible from multiple
pages
It’s easy to use
3 2012/05/18
4. Suggest Convention
External templates is to prefix the file name with an
underscore
Suffix all template files with .tmpl.html
4 2012/05/18
10. Registering Custom Tags
JsRender offers several powerful extensibility points
such as
A. custom tags
B. converters
C. helper functions and template parameters
The syntax for calling each of these is shown here
a {{myTag name}}
a {{myConverter:name}}
a {{:~myHelper(name)}}
{{:~myParameter}}
10 2012/05/18