Created
October 7, 2011 02:56
-
-
Save dirkkelly/1269330 to your computer and use it in GitHub Desktop.
Spine.js Mobile Routing (http://spinejs.com/docs/routing)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Uncaught Unknown record | |
Model.find | |
ProfilesShow.active | |
__bind | |
Profiles.routes./profiles/:id | |
Module.proxy | |
__bind | |
Spine.Route.Route.match | |
Spine.Route.Route.matchRoute | |
Spine.Route.Route.navigate | |
Spine.Controller.include.navigate | |
UsersNew.active | |
__bind | |
Users.routes./users/new | |
Module.proxy | |
__bind | |
Spine.Route.Route.match | |
Spine.Route.Route.matchRoute | |
Spine.Route.Route.navigate | |
Spine.Controller.include.navigate | |
App | |
(anonymous function):9294/:13 | |
jQuery.extend._Deferred.deferred.resolveWith | |
jQuery.extend.ready | |
DOMContentLoaded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App extends Stage.Global | |
constructor: -> | |
super | |
@profiles = new Profiles | |
Spine.Route.setup() | |
@navigate '/profiles/new' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProfilesNew extends Panel | |
constructor: -> | |
super | |
... | |
active: => | |
... | |
@render() | |
class ProfilesShow extends Panel | |
constructor: -> | |
super | |
... | |
active: => | |
... | |
@profile = Profile.find(params.id) | |
@render() | |
class Profiles extends Spine.Controller | |
constructor: -> | |
super | |
@newProfile = new ProfilesNew | |
@showProfile = new ProfilesShow | |
@routes | |
'/profiles/new': (params) -> @newProfile.active(params) | |
'/profiles/:id': (params) -> @showProfile.active(params) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment