Skip to content

Instantly share code, notes, and snippets.

@uris77
Created November 12, 2013 20:34
Show Gist options
  • Save uris77/7438181 to your computer and use it in GitHub Desktop.
Save uris77/7438181 to your computer and use it in GitHub Desktop.
# Movies sub-module
require ['app'], (MyApp) ->
MyApp.module 'Movie', (Movie, MyApp, Backbone, Marionette, $, _) ->
Movie.on 'start', ->
.....
# A file movies/ListViews
require ['app'], (MyApp) ->
MyApp.module 'Movie.Views', (Views, MyApp, Backbone, Marionette, $, _) ->
class Views.ItemView extends Marionette.ItemView
class Views.CollectionView extends Marionette.CollectionView
itemView: Views.ItemView
Views
# A controller that uses views
require ['app', 'moviews/ListViews'], (MyApp) ->
MyApp.module 'Movie.Main', (Main, MyApp, Backbone, Marionette, $, _) ->
class Main.Controller extends Marionette.Controller
initialize: (options) ->
@region = options.region
moviesListView = new MyApp.Movie.Views.CollectionView
collection: options.collection
@region.show moviesListView
Main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment