elements
elements copied to clipboard
Add html module that generates DOM nodes
Much like mootools-more Elements.from.
Especially with template engines like handlebars, moustache, and all those others that generate a string with html.
var html = require('elements/html')
html("<div>it's-a me, Mario!</div>").insert('#wrapper')
I would rather name it it html2dom or elements or something :)
Also a better example would be
html("<div>it's-a me, Mario!</div><div>and Koopa Troopa!</div>").insert('#wrapper')
var elements = require('elements')
elements.from("
?
On Wed, Apr 10, 2013 at 8:11 AM, Piotr Zalewa [email protected]:
I would rather name it it html2dom or something :)
— Reply to this email directly or view it on GitHubhttps://github.com/mootools/elements/issues/12#issuecomment-16172969 .
@ibolmo :+1:
@ibolmo no.
var whatchagonnacallit = require("elements/fromHTML")
namespacing is so 1999
So, for example:
var elements = require('elements');
elements.from = require('elements/fromHTML');
:-D
Yep that's all fine and dandy. You can obviously tell my example came from Python dependency system, haha.
On Thu, Apr 11, 2013 at 5:28 AM, Tim Wienk [email protected] wrote:
So, for example:
var elements = require('elements');elements.from = require('elements/fromHTML');
:-D
— Reply to this email directly or view it on GitHubhttps://github.com/mootools/elements/issues/12#issuecomment-16226963 .