diff --git a/docs/components.md b/docs/components.md index 7aca51a9..da76aa66 100644 --- a/docs/components.md +++ b/docs/components.md @@ -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. diff --git a/docs/getting-started.md b/docs/getting-started.md index dd453245..b0f0db02 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -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. --- diff --git a/docs/mithril.mount.md b/docs/mithril.mount.md index 76edfc9f..b742224b 100644 --- a/docs/mithril.mount.md +++ b/docs/mithril.mount.md @@ -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.