From 16e6f6fdd51a0c3f597064d7d475d4d28f6968a5 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Thu, 29 May 2014 22:20:46 -0400 Subject: [PATCH] clarify controller in guide --- archive/v0.1.15/getting-started.html | 3 ++- archive/v0.1.15/mithril.min.zip | Bin 46114 -> 46114 bytes docs/getting-started.md | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/archive/v0.1.15/getting-started.html b/archive/v0.1.15/getting-started.html index 4c1c5a5f..e2b942bc 100644 --- a/archive/v0.1.15/getting-started.html +++ b/archive/v0.1.15/getting-started.html @@ -130,7 +130,8 @@ todo.controller = function() { } }; } -

The code above should hopefully be self-explanatory. You can use the controller like this:

+

The code above defines a controller class. It has three members: list, which is simply an array, description, which is an m.prop getter-setter function with an empty string as the initial value, and add, which is a method that adds a new Todo instance to list if an input description getter-setter is not an empty string. Later in this guide, we'll pass the description property as the parameter to this function. I'll explain why we're passing it as an argument when we get there.

+

You can use the controller like this:

var ctrl = new todo.controller();
 
 ctrl.description(); //[empty string]
diff --git a/archive/v0.1.15/mithril.min.zip b/archive/v0.1.15/mithril.min.zip
index e8ddf7e3ec25249345358f599f28f5a92c1b44ef..19e5549e38218680da05c749c42c009893f3da64 100644
GIT binary patch
delta 60
zcmZ4Vf@#qUCY}IqW)?065NO-9ktbiBscqBdT6GzF5IsBXj1Q2WoVnQwL@nKH4Wb@x
Gb^ri#P8V|k

delta 60
zcmZ4Vf@#qUCY}IqW)?065ZJL{BTv3M(~b?BYt?1!LG