-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
27 lines (22 loc) · 703 Bytes
/
Copy pathindex.html
File metadata and controls
27 lines (22 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script src="jquery-1.11.2.js"></script>
<script src="underscore.js"></script>
<script src="backbone.js"></script>
<script>
var Fruit = Backbone.Model.extend({ // Create model with initialize function
});
var FruitS = Backbone.Collection.extend({ // Create collection
model: Fruit
});
var fruitcollection = new FruitS({ type: 'apple', color: 'red' }); // create new instance of collection, and add items when it is created.
fruitcollection.add({ type: 'banana', color: 'yellow' }); // or, add items using add function.
console.log(fruitcollection);
</script>
</body>
</html>