1. // ClojureScript
  2. (bb/defview SctSummary
  3. :className "sct-summary"
  4. :events {"click" "do_stuff"}
  5. :render ([]
  6. (html this "<div>MY VIEW FROM CLOJURE</view>"))
  7. :do_stuff ([]
  8. (js/alert "hello")))
  9. // JavaScript
  10. SctSummary = Backbone.View.extend(
  11. {className: "sct-summary",
  12. events: {"click": "do_stuff"},
  13. render: function() {
  14. this.$el.html("<div>MY VIEW FROM CLOJURE</view>");
  15. },
  16. do_stuff: function() {
  17. alert('hello');
  18. }
  19. });