Open netom opened 13 years ago
Awesome :-). Could you also include unit tests for this. Thanks.
I have to admit that I having hard time writing proper for this functionality. My problem is that routing is sooo deep inside SC that I can't imagine writing a unit test without writing a dummy-router. My problem with this is that it'd make the unit test so complicated and closely coupled with the SC routing, that it'd lose its purpose.
Any thoughts on this?
On 28 March 2011 18:58, FrozenCanuck reply@reply.github.com wrote:
Awesome :-). Could you also include unit tests for this. Thanks.
Reply to this email directly or view it on GitHub: https://github.com/FrozenCanuck/Ki/issues/29#comment_926955
I've made a patch to ki to enable adding a "route" hash property to State objects. Based on this property the State init() does SC.routes.add, so the router can trigger gotoState or sendEvent (based on this "route" property).
I've added a setLocation('optional location string') to make easy to set browser location based on the state's "route" property.
Example: ... rootState: Ki.State.design({
Patch: