Comments (7)
Along the same line, it would be nice if JsRender exposed itself as an AMD module so asynchronous loaders like RequireJS and curl.js can use it. jQuery now registers itself as an AMD module as of version 1.7.
from jsrender.
It should now be compliant. It does not use 'window'. I'll look at the AMD registration idea, so keeping this issue open.
from jsrender.
If you have questions on how to pull in the AMD registration, feel free to let me know. Here is a umdjs example that may be applicable here: https://github.com/umdjs/umd/blob/master/returnExports.js
from jsrender.
Glancing through the code, it looks like if jQuery is present, methods are attached to $, otherwise they're attached to a custom object. I would think in order to do AMD registration, methods would need to be attached to the custom object under both circumstances and that object would be the one returned.
require( [ 'jsrender' ], function( jsrender ){
jsrender.render[ 'myTemplate' ]( myData );
} );
from jsrender.
Yes, you are right about the behavior.
I may not look more closely at AMD until JsViews and JsRender both get to Beta. (And James, yes I'll let you know if I have questions).
from jsrender.
I may not look more closely at AMD until JsViews and JsRender both get to Beta.
Any new developments on this?
from jsrender.
JsRender is now fully AMD and commonJs compliant - as is JsViews.
JsRender is available as a Node module. See https://www.npmjs.com/package/jsrender and https://github.com/BorisMoore/jsrender-node-starter
from jsrender.
Related Issues (20)
- renderFile to accept a file as input HOT 2
- Nested props loop is not picking up properties of a function HOT 4
- any breaking changes between 0.9.82 and current 1.0.5 ? HOT 2
- JSRender strips multiple white spaces from input HOT 3
- Node + jsRender: allow absolute paths, (and also passing context to renderFile) HOT 8
- space is not html-encoded HOT 6
- regex not working HOT 2
- Difference between Browser and Node app - Null Propagation Operator HOT 2
- Conditional check if equal to string HOT 5
- Incomplete jsrender.min.map file HOT 2
- Provide support for passing an ID selector to $.templates() even when using JsRender without jQuery HOT 6
- Please provide a good documentation on how to use this in Angular 8+ or React 9+ versions HOT 2
- {{if}} tag doesn't work on keys with array or object with properties HOT 1
- swig.renderFile gives callback function required error HOT 3
- Chrome Extension Manifest V3 HOT 3
- $(...).render is not a function HOT 1
- How can I load data from jsrender template and update it HOT 2
- Using a tmpl selector that begins with a # but is not an ID selector does not work HOT 1
- Get an error t is not a function when adding if block HOT 1
- Using {{for array}} with filtering HOT 1
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 jsrender.