Step 3 - Contacts Collection
-
Add collections/contacts.js with collection:
ContactManager.Collections.Contacts = Backbone.Collection.extend({ model: ContactManager.Models.Contact });
and to index.html:
<script src="app/js/collections/contacts.js"></script>
-
Create collections with few models in DevTools and show some methods
var contacts = new ContactManager.Collections.Contacts([ { id: 1, name : 'Terrence S. Hatfield', tel: '651-603-1723', email: '[email protected]' }, { id: 2, name : 'Chris M. Manning', tel: '513-307-5859', email: '[email protected]' }, ])