Created
December 30, 2014 14:37
-
-
Save linus-amg/aa0ebc415934ba17be52 to your computer and use it in GitHub Desktop.
Valid controller pattern for repetitive shows?
This file contains 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
NavigationView = require 'views/navigation.coffee' | |
HomeView = require 'views/home.coffee' | |
OtherView = require 'views/other.coffee' | |
LogoutView = require 'views/logout.coffee' | |
ListView = require 'views/list/index.coffee' | |
TableView = require 'views/table/index.coffee' | |
ListCollection = require 'collections/list.coffee' | |
TableCollection = require 'collections/table.coffee' | |
module.exports = Marionette.Controller.extend | |
initialize: (options) -> | |
@App = options.App | |
displayNavigation: -> | |
@NavigationView = @NavigationView || new NavigationView | |
@App.header.show @NavigationView | |
home: -> | |
@displayNavigation() | |
@App.main.show new HomeView | |
other: -> | |
@displayNavigation() | |
@App.main.show new OtherView | |
logout: -> | |
@displayNavigation() | |
@App.main.show new LogoutView | |
list: -> | |
@displayNavigation() | |
@App.main.show new ListView | |
collection: new ListCollection | |
table: -> | |
@displayNavigation() | |
@App.main.show new TableView | |
collection: new TableCollection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment