Comments (5)
@nhunzaker Is this similiar to what we are discussing?
from plates.
@pksunkara Yes, I had been playing around with something similar a few days ago. Basically, I made it so that some of the map methods could be passed functions which would use the returned value instead of the value in the data argument of the bind method.
var data = { foo : "auto" };
map.where("class").is("todo-content").insert(function(data) {
return data.foo + " complete";
});
I feel like this would be implemented similarly for issue #30 as well.
from plates.
@nhunzaker Your example looks useful. Do you have this implementation committed in your fork? I browsed through your commits but it wasn't immediately obvious.
from plates.
@tauren My apologies, it got bundled in with the iteration fixes and I pulled it out. @pksunkara should be working on a similar, permanent solution.
from plates.
Closing this, you can now do:
var map = new plates.Map();
map.className('pewpew').use(function render(data, value, tagbody) {
return 'pewpew' + data.pewpew + value;
});
from plates.
Related Issues (20)
- Multiple clauses does not render correctly HOT 2
- Option to allow/disallow undefined attributes HOT 1
- Better common.js support HOT 1
- Provide a proper way to avoid XSS attacks
- Problem with function compileMappings, and how i (might have) fixed it.
- .append() or .partial doesn't work with inputs HOT 1
- Partials HOT 1
- Tests failing on latest Node.js HOT 1
- State of this library HOT 3
- Overrides elements with bad content HOT 2
- Plates (fork?) with some DSL HOT 1
- Collection iteration HOT 1
- Binding doesn't work as expected HOT 1
- Question, not Issue: Getting the innerHTML of a tag for multi-language support
- Not able to get the correct HTML output
- BUG: "Template" may not contain "Subtemplates" tag name HOT 1
- Old Version on Bower HOT 1
- Example project with template nesting HOT 1
- Mapping the same partial multiple times with collections example
- Map to a valueless attribute
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 plates.