Skip to content

Instantly share code, notes, and snippets.

@workmaster2n
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save workmaster2n/d613de6d58439fb81598 to your computer and use it in GitHub Desktop.
Save workmaster2n/d613de6d58439fb81598 to your computer and use it in GitHub Desktop.
router issue
this.App = (function(Backbone, Marionette) {
var Arc;
Arc = new Marionette.Application;
Arc.addRegions({
container: "#container"
});
Arc.on('before:start', function() {
return Arc.workers = App.request('entities:workers');
});
Arc.on("start", function() {
if (Backbone.history) {
return Backbone.history.start({
pushState: false
});
}
});
return Arc;
})(Backbone, Marionette);
@App = do(Backbone, Marionette) ->
Arc = new Marionette.Application
Arc.addRegions
container: "#container"
Arc.on 'before:start', ->
Arc.workers = App.request('entities:workers')
Arc.on "start", ->
if Backbone.history
Backbone.history.start(pushState: false)
Arc
var __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
__hasProp = {}.hasOwnProperty;
this.App.module("LocationApp", function(LocationApp, App, Backbone, Marionette, $, _) {
var API;
API = {
showLocation: function(id) {
return LocationApp.Show.Controller.showLocation(id);
}
};
LocationApp.Router = (function(_super) {
__extends(Router, _super);
function Router() {
return Router.__super__.constructor.apply(this, arguments);
}
Router.prototype.appRoutes = {
"locations/:id": "showLocation"
};
Router.prototype.controller = API;
return Router;
})(Marionette.AppRouter);
return App.on("before:start", function() {
return new LocationApp.Router;
});
});
@App.module "LocationApp", (LocationApp, App, Backbone, Marionette, $, _) ->
API =
showLocation: (id)->
LocationApp.Show.Controller.showLocation(id)
class LocationApp.Router extends Marionette.AppRouter
appRoutes:
"locations/:id": "showLocation"
controller: API
App.on "before:start", ->
new LocationApp.Router
var __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
__hasProp = {}.hasOwnProperty;
this.App.module("LocationGridApp", function(LocationGridApp, App, Backbone, Marionette, $, _) {
var API;
API = {
showLocationGrid: function() {
return LocationGridApp.Show.Controller.showLocationGrid();
}
};
LocationGridApp.Router = (function(_super) {
__extends(Router, _super);
function Router() {
return Router.__super__.constructor.apply(this, arguments);
}
Router.prototype.appRoutes = {
"": "showLocationGrid"
};
Router.prototype.controller = API;
return Router;
})(Marionette.AppRouter);
return App.on('before:start', function() {
return new LocationGridApp.Router;
});
});
@App.module "LocationGridApp", (LocationGridApp, App, Backbone, Marionette, $, _) ->
API =
showLocationGrid: ->
LocationGridApp.Show.Controller.showLocationGrid()
class LocationGridApp.Router extends Marionette.AppRouter
appRoutes:
"" : "showLocationGrid"
controller: API
App.on 'before:start', ->
new LocationGridApp.Router
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment