Socket
Book a DemoInstallSign in
Socket

ember-router-dsl

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-router-dsl

router dsl for more descriptive routes and easier automation

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

Ember-router-dsl

Exposes the following methods

{namespace, children, child, collection, model, view, form} = DSL.import @

Use in your router.coffee or router.js file like so:

import DSL from 'ember-router-dsl'
Router.map ->
  {namespace, children, child, collection, model, view, form} = DSL.import @
  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:

Route.extend
  routeData: service "route-data"
  model: ->
    @routeData.routeOptions "dashboard.projects"
    @routeData.routeModel "dashboard.project" # project
    @routeData.routeType "dashboard.project" # model
    @routeData.routeAction "dashboard.project.index" # model#index
    @routeData.parentNodeRoute "dashboard.project.cad-files.index" # dashboard.project
    @routeData.modelRoute "project" # dashboard.project
    @routeData.collectionRoute "project" # dashboard.projects
    @routeData.childRoute()
    @routeData.childrenRoute()
    @routeData.modelRoutes()
    @routeData.collectionRoutes()
    @routeData.childRoutes()
    @routeData.childrenRoutes()

in the router.js file as well as a routerData service that holds meta data for the routes

Installation

  • git clone this repository
  • npm install
  • bower install

Running

  • ember server
  • Visit your app at http://localhost:4200.

Running Tests

  • npm test (Runs ember 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/.

Keywords

ember-addon

FAQs

Package last updated on 15 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts