tildeio/router.js — pull request #35 by ghedamat (2013-07-10 15:08:40+00:00)
Title: handle transition as return value in beforeModel and afterModel

This is an attempt to fix #34

As said in the issue, it can easily happen for coffeescript users to accidentally return a transition within a beforeModel or and afterModel hook.

After a chat with @machty I've handled this situation as a special case.

This PR handles only the beforeModel and afterModel hooks
I'm not sure if and how to proceed in the model hook (shall people be able to even call transitionTo in a model hook?)

Assuming that this is the right approach let me know if you need any change to the code.