Pathguard is an experimental alternative router map DSL.
To activate pathguard import it into your router.js:
import Ember from 'ember';
import 'ember-pathguard/register';
Router.map(function() {
this.guard('authenticated', function() {
this.path('dashboard');
this.path('projects', function() {
this.path(':project_id', { as: 'project' });
});
});
this.path('signin');
this.path('signup');
});- Only one
this.guardmay be present in the router map. - Substates (loading/error) are not supported yet.
- Relative names:
as: './post' - Absolute paths:
this.path('/users/home')
git clonethis repositorynpm installbower install
ember server- Visit your app at http://localhost:4200.
ember testember test --server
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.