backbone: clarify sections

This commit is contained in:
Rico Sta. Cruz 2017-09-04 16:48:18 +08:00
parent 19887637fb
commit 7196d18f31
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
1 changed files with 7 additions and 2 deletions

View File

@ -69,7 +69,9 @@ view.stopListening()
* `route:[name]` (params)
* `route` (router, route, params)
### Views
## Views
### Defining
```js
// All attributes are optional
@ -101,15 +103,18 @@ var View = Backbone.View.extend({
render: function() { ··· }
})
```
### Instanciating
```js
view = new View()
view = new View({ el: ··· })
```
### Methods
```js
view.$el.show()
view.$("input")
view.$('input')
```
```js