myTD
myTD

Reputation: 1469

backbone Finding the current page

Is there a built in call to find out the current page, in a bootstrap environment.. I am trying to hide some of the links depending on the page i am on. we have a router as follows;

var AppRouter = Backbone.Router.extend({
    routes : {
        // Define some URL routes
        'login' : 'showLogin',
        'main' : 'showMain',
        'faq' : 'showFaq
}

Upvotes: 1

Views: 5441

Answers (1)

Cyclone
Cyclone

Reputation: 1580

If you're looking for the last route triggered in the router then you can access it using

Backbone.history.fragment

Provided history was started after initializing routers.

Upvotes: 7

Related Questions