Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.App = {}
- # models
- App.Employee = Backbone.Model.extend()
- App.Employees = Backbone.Collection.extend
- model: App.Employee
- # views
- App.EmployeeView = Backbone.View.extend
- initialize: ->
- @model.on('change', @render, this)
- @model.on('destroy', @remove, this)
- render: ->
- fullName = "#{@model.get('firstName')} #{@model.get('lastName')} "
- this.$el.text(fullName)
- this
- App.EmployeesView = Backbone.View.extend
- collection: new App.Employees()
- initialize: ->
- @collection.on('add', ...)
- @collection.on('reset', ...)
Add Comment
Please, Sign In to add comment