Comments (2)
@schacki : This looks great! I've been thinking about doing something similar for awhile now.
Generally in my apps, I avoid using the router as the navigation mechanism from within the app. Instead, I use an event-based system for page changes, and then my router listens to those changes and updates the URL accordingly.
The problem with this is that I've been forced to have my router interpret every type of navigation event, and conditionally construct the URL based on hardcoded logic in a nasty if/else block. With your solution, this logic would be much cleaner.
Please submit a pull request and I will accept it. This repo is in dire need of a sample app so that we can test features such as this, but I haven't had time to make one.
Thanks for contributing!
from backbone.subroute.
I am happy to send you a pull request, just be aware that it is completely
untested. Not even the syntax is tested, since I only had the chance to
edit the code in the Github edit mode last days.
On Wednesday, August 22, 2012, Dave Cadwallader wrote:
@schacki https://github.com/schacki : This looks great! I've been
thinking about doing something similar for awhile now.Generally in my apps, I avoid using the router as the navigation mechanism
from within the app. Instead, I use an event-based system for page
changes, and then my router listens to those changes and updates the URL
accordingly.The problem with this is that I've been forced to have my router interpret
every type of navigation event, and conditionally construct the URL based
on hardcoded logic in a nasty if/else block. With your solution, this logic
would be much cleaner.Please submit a pull request and I will accept it. This repo is in dire
need of a sample app so that we can test features such as this, but I
haven't had time to make one.Thanks for contributing!
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-7938996.
from backbone.subroute.
Related Issues (20)
- Routes with named params HOT 6
- How can I restart subroutes? HOT 2
- Suggestion: returning Backbone.navigate or at least returning "this" HOT 3
- Polluted Routes when using a common base router class HOT 5
- Problem with Backbone AMD HOT 3
- Minified version produces wrong route HOT 1
- Filter support HOT 5
- Publish latest version to npm HOT 1
- Backbone and underscore should be dependencies (not devDependencies) HOT 1
- Route gets triggered twice HOT 3
- accessing router initialize parameters from the route callback? HOT 3
- using back button does not re-trigger all my routes
- loadUrl into uninitialized subroute fails HOT 3
- Seeking New Ownership! HOT 6
- Specify createTrailingSlashRoutes as an instance property when extending from Backbone.Subroute
- handling zombie views in the subroute
- Update bower info
- npm support
- Regex routes
- Multiple SubRoutes - is it possible?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from backbone.subroute.