gokatz
12/8/2016 - 8:59 AM

passing args to route

passing args to route

{
  "version": "0.10.6",
  "EmberENV": {
    "FEATURES": {}
  },
  "options": {
    "use_pods": false,
    "enable-testing": false
  },
  "dependencies": {
    "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
    "ember": "2.9.0",
    "ember-data": "2.9.0",
    "ember-template-compiler": "2.9.0",
    "ember-testing": "2.9.0"
  },
  "addons": {}
}
<h1>Welcome to {{appName}}</h1>
<br>
{{#link-to 'page' pageObj}}Go to Pages{{/link-to}}
<br>
{{outlet}}
<br>
<br>
import Ember from 'ember';
import config from './config/environment';

const Router = Ember.Router.extend({
  location: 'none',
  rootURL: config.rootURL
});

Router.map(function() {
  this.route('page', { path: 'page/:page_id'});
});

export default Router;
import Ember from 'ember';

export default Ember.Controller.extend({
  appName: 'Ember Twiddle',
  pageObj: {
  	page_id: 1,
    test: '1'
  }
});