diff --git a/archive/v0.1/getting-started.html b/archive/v0.1/getting-started.html index b19cfafe..b63cb2e4 100644 --- a/archive/v0.1/getting-started.html +++ b/archive/v0.1/getting-started.html @@ -81,16 +81,16 @@ todo.Todo = function(data) { todo.TodoList = Array;

m.prop is simply a factory for a getter-setter function. Getter-setters work like this:

//define a getter-setter with initial value `John`
-var firstName = m.prop("John");
+var name = m.prop("John");
 
 //read the value
-var a = firstName(); //a == "John"
+var a = name(); //a == "John"
 
 //set the value to `Mary`
-firstName("Mary"); //Mary
+name("Mary"); //Mary
 
 //read the value
-var b = firstName(); //b == "Mary"
+var b = name(); //b == "Mary"

Note that the Todo and TodoList classes we defined above are plain vanilla Javascript constructors. They can be initialized and used like this:

var myTask = new todo.Todo({description: "Write code"});
 
@@ -442,4 +442,4 @@ this.description = function(value) {
 		
 		
 	
-
+
\ No newline at end of file
diff --git a/archive/v0.1/mithril.prop.html b/archive/v0.1/mithril.prop.html
index 91a4b609..20d9d07a 100644
--- a/archive/v0.1/mithril.prop.html
+++ b/archive/v0.1/mithril.prop.html
@@ -64,16 +64,16 @@
 

Usage

//define a getter-setter with initial value `John`
-var firstName = m.prop("John");
+var name = m.prop("John");
 
 //read the value
-var a = firstName(); //a == "John"
+var a = name(); //a == "John"
 
 //set the value to `Mary`
-firstName("Mary"); //Mary
+name("Mary"); //Mary
 
 //read the value
-var b = firstName(); //b == "Mary"
+var b = name(); //b == "Mary"

It can be used in conjunction with m.withAttr to implement data binding in the view-to-model direction and to provide uniform data access for model entity properties.

//a contrived example of bi-directional data binding
 var user = {
@@ -137,4 +137,4 @@ where:
 		
 		
 	
-
+
\ No newline at end of file