updated to v2
This commit is contained in:
14
src/main/coffeescript/view/ResourceView.coffee
Normal file
14
src/main/coffeescript/view/ResourceView.coffee
Normal file
@@ -0,0 +1,14 @@
|
||||
class ResourceView extends Backbone.View
|
||||
initialize: ->
|
||||
|
||||
render: ->
|
||||
$(@el).html(Handlebars.templates.resource(@model))
|
||||
|
||||
# Render each operation
|
||||
@addOperation operation for operation in @model.operationsArray
|
||||
@
|
||||
|
||||
addOperation: (operation) ->
|
||||
# Render an operation and add it to operations li
|
||||
operationView = new OperationView({model: operation, tagName: 'li', className: 'endpoint'})
|
||||
$('.endpoints', $(@el)).append operationView.render().el
|
||||
Reference in New Issue
Block a user