Skip to content

Commit

Permalink
Merge pull request #13 from EWhite613/patch-1
Browse files Browse the repository at this point in the history
Add custom routing for demo. Making compatible with frost-guide
  • Loading branch information
sglanzer committed Mar 21, 2016
2 parents 6e67fb7 + 215fc87 commit d0f4e56
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"ember-try": "^0.2.0",
"eslint": "2.2.0",
"eslint-config-frost-standard": "^1.0.0",
"frost-guide-custom-routing": "0.0.4",
"loader.js": "^4.0.0"
},
"keywords": [
Expand Down
7 changes: 5 additions & 2 deletions tests/dummy/app/router.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import Ember from 'ember'
import config from './config/environment'
import addRoute from 'frost-guide-custom-routing/utils/addRoute'

var Router = Ember.Router.extend({
location: config.locationType
})

Router.map(function () {
this.route('demo', { path: '/' })
this.route('custom-login')
let routerConfig = config.APP.routingConfig
routerConfig.forEach((item) => {
addRoute.call(this, item)
})
})

export default Router
3 changes: 3 additions & 0 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var routingConfig = require('./routing')

module.exports = function (environment) {
var ENV = {
modulePrefix: 'dummy',
Expand All @@ -15,6 +17,7 @@ module.exports = function (environment) {
APP: {
// Here you can pass flags/options to your application instance
// when it is created
routingConfig: routingConfig
}
}

Expand Down
16 changes: 16 additions & 0 deletions tests/dummy/config/routing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = [
{
id: 'demo',
alias: 'Demo',
type: 'category',
route: 'demo',
path: {
path: '/'
}
}, {
id: 'custom-login',
alias: 'Custom Login',
type: 'category',
route: 'custom-login'
}
]

0 comments on commit d0f4e56

Please sign in to comment.