- // ClojureScript
- (bb/defview SctSummary
- :className "sct-summary"
- :events {"click" "do_stuff"}
- :render ([]
- (html this "<div>MY VIEW FROM CLOJURE</view>"))
- :do_stuff ([]
- (js/alert "hello")))
- // JavaScript
- SctSummary = Backbone.View.extend(
- {className: "sct-summary",
- events: {"click": "do_stuff"},
- render: function() {
- this.$el.html("<div>MY VIEW FROM CLOJURE</view>");
- },
- do_stuff: function() {
- alert('hello');
- }
- });