How to use the Router function from backbone

Find comprehensive JavaScript backbone.Router code examples handpicked from public code repositorys.

55
56
57
58
59
60
61
62
63
64
);
var userModel = new UserModel(userData, { configModel: configModel });
var modals = new ModalsServiceModel();
var tableModel = new TableModel(tableData, { parse: true, configModel: configModel });
var editorModel = new EditorModel();
var Router = new Backbone.Router();
var visModel = new VisTableModel(visData, { configModel: configModel });
var layersCollection = new Backbone.Collection(layersData);
var layerDataModel = layersCollection.find(function (mdl) {
  var kind = mdl.get('kind');
fork icon676
star icon0
watch icon4

70
71
72
73
74
75
76
77
78
79
80
81
82
            }
        }
        return self; 
    }


    Router = Backbone.Router.extend( Router() );


})(jQuery);


module.exports = Router;
fork icon0
star icon3
watch icon1

+ 5 other calls in file

214
215
216
217
218
219
220
221
222
223
224
225


/*
 * ROUTES
 */


app.AppRoutes = Backbone.Router.extend({
  routes: {
    ':name': 'app',
    ':name/:endpoint': 'app2',
    ':name/:endpoint/:key': 'app3'
fork icon7
star icon1
watch icon3

645
646
647
648
649
650
651
652
653
654
655
656
    }
});


const react = ReactDOM.render(<TodoApp name="todo-app" collection={todoItems} users={users.models}/>,
    document.getElementById('todo'));
const Router = Backbone.Router.extend({


    routes: {
        '': 'all',
        'active': 'active',
fork icon0
star icon0
watch icon0

40
41
42
43
44
45
46
47
48
49
50
51


function authenticated() {
  return PolisStorage.uid() || PolisStorage.uidFromCookie() || window.authenticatedByHeader;
}


var polisRouter = Backbone.Router.extend({
  gotoRoute: function(route, options) {
    // this.navigate(route, options);
    window.location = route;
  },
fork icon0
star icon0
watch icon1

+ 2 other calls in file