Ember-router-dsl
Exposes the following methods
DSLimport @
Use in your router.coffee
or router.js
file like so:
import DSL from 'ember-router-dsl'Routermap -> DSLimport @ namespace "dashboard"-> collection "projects"-> form "new" view "search" model "project"-> form "edit" children "cad-files"as: "file" children "versions" child "owner"as: "user"
Then, you can access the expected metadata using the routeData
service like so:
Routeextend routeData: service "route-data" : -> @routeDatarouteOptions "dashboard.projects" @routeDatarouteModel "dashboard.project" # project @routeDatarouteType "dashboard.project" # model @routeDatarouteAction "dashboard.project.index" # model#index @routeDataparentNodeRoute "dashboard.project.cad-files.index" # dashboard.project @routeDatamodelRoute "project" # dashboard.project @routeDatacollectionRoute "project" # dashboard.projects @routeDatachildRoute @routeDatachildrenRoute @routeDatamodelRoutes @routeDatacollectionRoutes @routeDatachildRoutes @routeDatachildrenRoutes
in the router.js
file as well as a routerData
service that holds meta data for the routes
Installation
git clone
this repositorynpm install
bower install
Running
ember server
- Visit your app at http://localhost:4200.
Running Tests
npm test
(Runsember try:testall
to test your addon against multiple Ember versions)ember test
ember test --server
Building
ember build
For more information on using ember-cli, visit http://ember-cli.com/.