mithril.js
mithril.js copied to clipboard
Tutorial code from flems.io doesn't work with Mithrill 2.0
Hey!
If I try to reproduce the tutorial app using the code from flems.io I get an error mithril.withAttrs is not a function. When I use the same code from mithrill.js.org everything works just fine. As it turns out the code on flems.io is not updated to work with Mithrill 2.0.
Here's the link to the file on flems.io causing problems with Mithrill 2.0 (lines 12 and 17)
Example,
this line
oninput: m.withAttr("value", function(value) {User.current.firstName = value}),
should be changed to this line
oninput: function (e) { User.current.firstName = e.target.value }
Thank you for the great framework!
@Manidos great catch! You should PR that :)
@Manidos great catch! You should PR that :)
Here's link to updated code on flems.io. It has [email protected] as the dependancy.
Somebody needs to update the link in the tutorial here I don't know how to make a PR for it.
@Manidos Check out this. The docs files are all in this directory, and the file in question is here.
And usually, when we say "PR", we use it as short for "pull request". It's much easier to type.
I'm not sure if I need to post it here, but anyway. Here's pull request https://github.com/MithrilJS/mithril.js/pull/2403