Merge remote-tracking branch 'origin/next' into next
This commit is contained in:
commit
0ec4ed451f
3 changed files with 3 additions and 2 deletions
|
|
@ -432,7 +432,7 @@ var ContactList = {
|
|||
m.mount(document.body, ContactsWidget)
|
||||
```
|
||||
|
||||
Here we've moved `Contact.save(contact).then(Observable.broadcast("updateContact"))` out of the `ContactForm` component and into the model layer. In its place, `ContactForm` merely emits an action, which is then handled by this model layer observer.
|
||||
Here we've moved `Contact.save(contact).then(Observable.trigger("updateContact"))` out of the `ContactForm` component and into the model layer. In its place, `ContactForm` merely emits an action, which is then handled by this model layer observer.
|
||||
|
||||
This allows swapping the implementation of the `saveContact` handler without changing the `ContactForm` component.
|
||||
|
||||
|
|
|
|||
|
|
@ -499,6 +499,7 @@ m.mount(document, {controller: todo.controller, view: todo.view});
|
|||
```
|
||||
|
||||
This example is also available as a [jsFiddle](http://jsfiddle.net/milesmatthias/fbgypzbr/1/).
|
||||
There is also [Extended example](http://jsfiddle.net/glebcha/q7tvLxsa/) available on jsfiddle.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ where:
|
|||
|
||||
- **Component component**
|
||||
|
||||
A component is supposed to be an Object with two keys: `controller` and `view`. Each of those should point to a Javascript function
|
||||
A component is supposed to be an Object with two keys: `controller` and `view`. Each of those should point to a Javascript function. If the `controller` is omitted, Mithril will provide one, pointing to an empty function.
|
||||
|
||||
When `m.mount` is called, the controller function runs, and its return value is returned by the `m.mount` call.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue