merge to next

This commit is contained in:
Leo 2017-01-30 11:04:14 -05:00
commit 6ab2b6b6c3
31 changed files with 17724 additions and 1 deletions

View file

@ -306,6 +306,7 @@ var Header = {
}
}
<<<<<<< HEAD
m(Header, [
m("h1", "My title"),
m("h2", "Lorem ipsum"),
@ -320,6 +321,25 @@ m(Header, [
m("h2", "Lorem ipsum"),
])
```
=======
//ContactForm no longer calls `Contact.save`
var ContactForm = {
controller: function(args) {
var ctrl = this
ctrl.contact = m.prop(new Contact())
ctrl.save = function(contact) {
Observable.trigger("saveContact", {contact: contact})
ctrl.contact = m.prop(new Contact()) //reset to empty contact
}
return ctrl
},
view: function(ctrl, args) {
var contact = ctrl.contact()
return m("form", [
m("label", "Name"),
m("input", {oninput: m.withAttr("value", contact.name), value: contact.name()}),
>>>>>>> origin/next
The component above breaks the assumption that children will be output in the same contiguous format as they are received. It's difficult to understand the component without reading its implementation. Instead, use attributes as named parameters and reserve `children` for uniform child content: