forked from BorisMoore/jquery-tmpl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed the term: 'template context', to 'template item' - less techy…
… and more intuitive in meaning. A template renders against data, resulting in one template item (i.e. rendered template instance) for each data item, if the data is an array. If not, then it renders a single template item. The data structure (JS object) associated with a rendered template instance is also referred to as the template item. It has a parent, a data property, a template property, and a nodes property. Instead of trying to make the tmpl plugin play a dual role - rendering tempplates against data, and also returning the template context (now template item) of a target element, it is now used ONLY for rendering templates. Getting the template item of a target element is now provided by a specific plugin: tmplItem. So we have: A) $.tmpl and $.fn.tmpl - for rendering a template against data B) $.templates and $.fn.templates - for compiling markup and caching it as a named template, or for accessing the cached named template. C) $.tmplItem and $.fn.tmplItem - for getting the template item of a target element. This change also allows for a simpler more straightforward implementation of $.tmpl, and reduces the total size slightly.
- Loading branch information
1 parent
fbe8241
commit d0633ad
Showing
11 changed files
with
397 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.