From c5095707f681a8393b00bdd5b7b57dce89691f9d Mon Sep 17 00:00:00 2001 From: Danilo Cabello Date: Wed, 19 Mar 2014 08:27:55 -0400 Subject: [PATCH] Update module docs to receive controller as param in view --- docs/mithril.module.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/mithril.module.md b/docs/mithril.module.md index 4f686e5e..1c04791e 100644 --- a/docs/mithril.module.md +++ b/docs/mithril.module.md @@ -23,11 +23,11 @@ You can make anonymous modules out of existing classes ```javascript //controller class var dashboardController = function() { - this.greeting = "Hello"; + this.greeting = "Hello"; }; //view class -var dashboardView = function() { +var dashboardView = function(ctrl) { return m("h1", ctrl.greeting); }; @@ -43,11 +43,11 @@ var dashboard = {} //controller class dashboard.controller = function() { - this.greeting = "Hello"; + this.greeting = "Hello"; }; //view class -dashboard.view = function() { +dashboard.view = function(ctrl) { return m("h1", ctrl.greeting); };