Answer the question
In order to leave comments, you need to log in
Is there an event in Backbone.Router that happens BEFORE the route is called?
The "route" event fires after the function responsible for the route has run.
Is it possible to get an event like "before:route"?
Answer the question
In order to leave comments, you need to log in
No, it doesn't come out of the box. In general, all built-in events are described in the docs , if that.
I personally made routes “empty” in all backbone applications, they just fired the corresponding event on the global bus. In your case, you can fire an event at the beginning of the handler of the corresponding router or call the desired function. Well, or inherit from Backbone.Router and rewrite the route method accordingly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question