Skip to content

Commit 2abc808

Browse files
committed
change installation instructions to use Bower
1 parent b373dad commit 2abc808

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

README.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Backbone-Nested [![Build Status](https://secure.travis-ci.org/afeld/backbone-nested.png?branch=master)](http://travis-ci.org/afeld/backbone-nested)
22

3-
A plugin to make [Backbone.js](http://documentcloud.github.com/backbone) keep track of nested attributes. Download the latest version and see the changelog/history/release notes on the [Releases](https://github.com/afeld/backbone-nested/releases) page.
3+
A plugin to make [Backbone.js](http://documentcloud.github.com/backbone) keep track of nested attributes. Download the latest version and see the changelog/history/release notes on the [Releases](https://github.com/afeld/backbone-nested/releases) page. **Supports Backbone 0.9.x and 1.x.**
44

55
## The Need
66

@@ -28,19 +28,35 @@ Wouldn't it be awesome if you could do this?
2828
user.bind('change:name.first', function(){ ... });
2929
```
3030

31-
## Usage
31+
## Installation
32+
33+
### [Bower](http://bower.io/)
34+
35+
Recommended.
36+
37+
1. Install the latest version:
38+
39+
```bash
40+
bower install backbone backbone-nested-model jquery underscore --save
41+
```
3242

33-
1. Download the latest version [here](https://github.com/afeld/backbone-nested/tags), and add `backbone-nested.js` to your HTML `<head>`. **Supports Backbone 0.9.x and 1.x.**
43+
2. Add `backbone-nested.js` to your HTML `<head>`:
3444

3545
```html
36-
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
37-
<script type="text/javascript" src="underscore.js"></script>
38-
<script type="text/javascript" src="backbone.js"></script>
39-
<!-- must be after backbone.js -->
40-
<script type="text/javascript" src="backbone-nested.js"></script>
46+
<!-- must loaded in this order -->
47+
<script type="text/javascript" src="/bower_components/jquery/jquery.js"></script>
48+
<script type="text/javascript" src="/bower_components/underscore/underscore.js"></script>
49+
<script type="text/javascript" src="/bower_components/backbone/backbone.js"></script>
50+
<script type="text/javascript" src="/bower_components/backbone-nested-model/backbone-nested.js"></script>
4151
```
4252

43-
2. Change your models to extend from `Backbone.NestedModel`, e.g.
53+
### Manual
54+
55+
Download the latest [release](https://github.com/afeld/backbone-nested/releases) and the dependencies listed above, then include with script tags in your HTML.
56+
57+
## Usage
58+
59+
1. Change your models to extend from `Backbone.NestedModel`, e.g.
4460

4561
```javascript
4662
var Person = Backbone.Model.extend({ ... });
@@ -50,7 +66,7 @@ user.bind('change:name.first', function(){ ... });
5066
var Person = Backbone.NestedModel.extend({ ... });
5167
```
5268

53-
3. Change your getters and setters to not access nested attributes directly, e.g.
69+
2. Change your getters and setters to not access nested attributes directly, e.g.
5470

5571
```javascript
5672
user.get('name').first = 'Bob';

0 commit comments

Comments
 (0)