K
K
Klein Maximus2016-03-23 13:52:29
JavaScript
Klein Maximus, 2016-03-23 13:52:29

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

1 answer(s)
K
Konstantin Kitmanov, 2016-03-23
@kleinmaximus

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 question

Ask a Question

731 491 924 answers to any question