Skip to content

Instantly share code, notes, and snippets.

@dlrust
Created April 25, 2012 07:52
Show Gist options
  • Save dlrust/2487972 to your computer and use it in GitHub Desktop.
Save dlrust/2487972 to your computer and use it in GitHub Desktop.
define([
'jquery',
'another_view',
'cs!some_view'
], function($, AnotherView, SomeView) {
var view = new SomeView;
});
define([
'jquery',
'jquery-ui',
'depend!jquery.ui.nestedSortable[jquery-ui]'
], function($) {
// $.nestedSortable is available
});
define [
'jquery',
'underscore',
'depend!backbone[underscore]',
], ($) ->
class SomeView extends Backbone.View
initialize: ->
alert 'SomeView loading from coffeescript!'
return SomeView
define([
'jquery',
'text!templates/some_template_tmpl.html',
'underscore',
'depend!backbone[underscore]'
], function($, tmpl) {
var SomeView = Backbone.View.extend({
initialize: function() {
this.template = _.template(tmpl);
},
render: function() {
$(this.el).html(this.template());
return this;
}
});
return SomeView;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment