Skip to content

Commit e7ef9ce

Browse files
Random corrections
* Corrected syntax error * Made "Animals" singular to match other examples * Removed whitespace
1 parent b288670 commit e7ef9ce

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

_posts/2011-01-26-what-is-a-collection.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ posturl: http://backbonetutorials.com/what-is-a-collection
99

1010
Backbone collections are simply an ordered set of [models](/what-is-a-model). Such that it can be used in situations such as;
1111

12-
* Model: Student, Collection: ClassStudents
12+
* Model: Student, Collection: ClassStudents
1313
* Model: Todo Item, Collection: Todo List
14-
* Model: Animals, Collection: Zoo
14+
* Model: Animal, Collection: Zoo
1515

1616
Typically your collection will only use one type of model but models themselves are not limited to a type of collection;
1717

@@ -28,9 +28,10 @@ Here is a generic Model/Collection example.
2828
console.log("Music is the answer");
2929
}
3030
});
31-
31+
3232
var Album = Backbone.Collection.extend({
3333
model: Song
34+
});
3435

3536
{% endhighlight %}
3637

@@ -49,16 +50,16 @@ Now we are going to populate a collection with some useful data.
4950
console.log("Music is the answer");
5051
}
5152
});
52-
53+
5354
var Album = Backbone.Collection.extend({
5455
model: Song
5556
});
56-
57+
5758
var song1 = new Song({ name: "How Bizarre", artist: "OMC" });
5859
var song2 = new Song({ name: "Sexual Healing", artist: "Marvin Gaye" });
5960
var song3 = new Song({ name: "Talk It Over In Bed", artist: "OMC" });
60-
61+
6162
var myAlbum = new Album([ song1, song2, song3]);
6263
console.log( myAlbum.models ); // [song1, song2, song3]
63-
64+
6465
{% endhighlight %}

0 commit comments

Comments
 (0)