Comments (1)
The data
key is already taken to represent the template data in the updated$(el).mustache()
syntax; however we could use storeData: true
instead, eg:
$(el).mustache({
template: "my_template",
data: {
name: "Jonny",
colour: "blue"
},
method: "append"
storeData: true
});
The template data would then be accessible from the freshly created element, via:
$(el).data("templateData").name // Jonny.
from jquery-mustache.
Related Issues (20)
- window.Mustache is not set? HOT 4
- addFromDom() only gets templates from the body HOT 3
- addFromDom() doesn't work unless a template name is specified HOT 3
- Options.method ambiguous and dangerous HOT 2
- Allow default `$.fn.mustache` 'method' to be configured.
- $("selector").mustache(template,data) should return jquery function for the new element HOT 1
- Syntax error in the README.md HOT 1
- Load template file once and access templates in it several times HOT 4
- expose 'has' function HOT 4
- Failed to locate Mustache instance, are you sure it has been loaded? HOT 2
- html is rendered as text HOT 3
- [enhancement] Add missing bower.json.
- Altering mustache.load() to use within .when() HOT 6
- jquery1.9 load problems HOT 1
- jquery-Mustache and requireJS (AMD) HOT 1
- Getting a 404 despite having the right path, why? HOT 3
- unobstrusive function call not working HOT 6
- How to Use Parse?
- Events not fire on templates elements after load - Please put it in the read.me
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-mustache.