Socket
Book a DemoInstallSign in
Socket

ember-polymorphica

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-polymorphica

Strategy for declaring route and controller mixins from the router

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

Ember-polymorphica

Build Status

Ember mixin and registration service for creating polymorphic routes.

Example

Usage with special DSL in your router.coffee

`import SomeRouteMixin from '../mixins/some-route-mixin'`
`import SomeControllerMixin from '../mixins/some-controller-mixin'`

Router.map ->
  {namespace, collection, children, model, child, form, view} = DSL.import(@).with
    namespace:
      routeMixins: ["namespace-feature"]
      controllerMixins: ["namespace-controller"]
    collection:
      routeMixins: ["collection-feature"]
    model:
      routeMixins: ["model-feature"]
    form:
      routeMixins: ["terminal-feature"]

  namespace "dashboard", ->
    collection "projects", ->
      form "new"
      model "project", ->
        form "edit"
        children "histories"

      model "art-project", as: "project", ->
        form "edit"

    model "folder", ->
      children "image-files", as: "file"

Now, the dashboard route and all its children will have the SomeRouteMixin mixed in.

Dependencies

the following packages should be installed prior to use:

ember-router-dsl
ember-lodash
ember-inflector

Installation

  • git clone this repository
  • npm install
  • bower install

Running

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 20 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