fixing docs
This commit is contained in:
parent
7565347069
commit
eed9c23b3e
1 changed files with 7 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue