Skip to content

Instantly share code, notes, and snippets.

@somebody32
Created February 6, 2016 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save somebody32/878f5e6eb6d7a4d6a1fb to your computer and use it in GitHub Desktop.
Save somebody32/878f5e6eb6d7a4d6a1fb to your computer and use it in GitHub Desktop.
Extracting routes
port Backbone from 'backbone';
import $ from 'jquery';
+ import routes from './routes';
export default Backbone.Router.extend({
- routes: {
- 'about': 'about',
- },
+ routes,
about() {
$('#app').html(`You're viewing about page. It was loaded in async way`);
}
});
export default {
'about': 'about',
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment