https://github.com/one-com/requirejs-tpl
require.js plugin for loading templates and injecting them as <script type=text/html> elements
https://github.com/one-com/requirejs-tpl
Last synced: about 1 month ago
JSON representation
require.js plugin for loading templates and injecting them as <script type=text/html> elements
- Host: GitHub
- URL: https://github.com/one-com/requirejs-tpl
- Owner: One-com
- Created: 2013-06-05T09:25:42.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-09-25T15:31:59.000Z (over 7 years ago)
- Last Synced: 2025-03-28T00:45:03.771Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 3
- Watchers: 13
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Template plugin for RequireJs
-----------------------------[](http://badge.fury.io/js/requirejs-tpl)
[](https://travis-ci.org/One-com/requirejs-tpl)
[](https://coveralls.io/r/One-com/requirejs-tpl?branch=master)
[](https://david-dm.org/One-com/requirejs-tpl)Notice! this plugin requires the standard [text plugin](https://github.com/requirejs/text).
This plugin will allow you to require templates, as employed in KnockoutJS, via the ordinary dependency syntax.
Example:
define([
'tpl!templates/thing.ko'
], function () {
[... code ...]
});The above will fetch the `thing.ko` file, and insert it into the DOM in a script tag with the id `thing`.