Created
April 25, 2012 07:52
-
-
Save dlrust/2487972 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'jquery', | |
'another_view', | |
'cs!some_view' | |
], function($, AnotherView, SomeView) { | |
var view = new SomeView; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'jquery', | |
'jquery-ui', | |
'depend!jquery.ui.nestedSortable[jquery-ui]' | |
], function($) { | |
// $.nestedSortable is available | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define [ | |
'jquery', | |
'underscore', | |
'depend!backbone[underscore]', | |
], ($) -> | |
class SomeView extends Backbone.View | |
initialize: -> | |
alert 'SomeView loading from coffeescript!' | |
return SomeView |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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