From eed9c23b3e1b57949b87f42ad0a7734fd31c6f3a Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Thu, 21 Aug 2014 12:52:41 -0400 Subject: [PATCH] fixing docs --- docs/getting-started.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 9654f8f2..2cf038a8 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -473,13 +473,19 @@ becomes: ```javascript //private store -var description = data.description; +var description; //public getter-setter this.description = function(value) { if (arguments.length > 0) description = value.toUpperCase(); return description; } + +//make it serializable +this.description.toJSON = function() {return description} + +//set the value +this.description(data.description) ``` According to Mithril's philosophy, `list` and `description` are also considered model-level entities. This is a subtle but important point: model entities don't need to be full-blown custom classes.