mithril.js icon indicating copy to clipboard operation
mithril.js copied to clipboard

Tutorial code from flems.io doesn't work with Mithrill 2.0

Open ghost opened this issue 6 years ago • 4 comments

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!

ghost avatar Apr 05 '19 16:04 ghost

@Manidos great catch! You should PR that :)

CreaturesInUnitards avatar Apr 05 '19 16:04 CreaturesInUnitards

@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.

ghost avatar Apr 05 '19 17:04 ghost

@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.

dead-claudia avatar Apr 05 '19 18:04 dead-claudia

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

ghost avatar Apr 06 '19 08:04 ghost