Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

defaults don't need to be a function

  • Loading branch information...
commit a60bc7e722ebddb4753d6931dae1c39e99e598ee 1 parent bb60a82
@kjbekkelund authored
Showing with 11 additions and 15 deletions.
  1. +11 −15 index.md
View
26 index.md
@@ -652,7 +652,7 @@ There are times when you want your model to have a set of default values (e.g. i
```javascript
var Photo = Backbone.Model.extend({
- defaults:{
+ defaults: {
title: 'Another photo!',
tags: ['untagged'],
location: 'home',
@@ -684,7 +684,7 @@ In the following example, we log a message whenever a specific attribute (the ti
```javascript
var Photo = Backbone.Model.extend({
- defaults:{
+ defaults: {
title: 'Another photo!',
tags: ['untagged'],
location: 'home',
@@ -3959,7 +3959,7 @@ window.mobileSearch = window.mobileSearch || {
workspace:new Workspace()
},
utils: utils,
- defaults:{
+ defaults: {
resultsPerPage: 16,
safeSearch: 2,
maxDate:'',
@@ -4299,12 +4299,10 @@ If testing this spec before your models have been written, you'll incur a failin
window.Todo = Backbone.Model.extend({
- defaults: function() {
- return {
- text: "",
- done: false,
- order: 0
- };
+ defaults: {
+ text: "",
+ done: false,
+ order: 0
}
```
@@ -4393,12 +4391,10 @@ function sanitize(str) {
window.Todo = Backbone.Model.extend({
- defaults: function() {
- return {
- text: '',
- done: false,
- order: 0
- };
+ defaults: {
+ text: '',
+ done: false,
+ order: 0
},
initialize: function() {
Please sign in to comment.
Something went wrong with that request. Please try again.