gokatz
12/28/2016 - 12:37 PM

qp test

qp test

{
  "version": "0.10.7",
  "EmberENV": {
    "FEATURES": {}
  },
  "options": {
    "use_pods": false,
    "enable-testing": false
  },
  "dependencies": {
    "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
    "ember": "1.13.13",
    "ember-data": "2.10.0",
    "ember-template-compiler": "1.13.13",
    "ember-testing": "1.13.13"
  },
  "addons": {}
}
<h1>Welcome to {{appName}}</h1>
<br>
{{#link-to 'one' (query-params page=2)}}ONE{{/link-to}}
{{#link-to 'two'}}TWO{{/link-to}}
<br>
{{outlet}}
<br>
<br>
import Ember from 'ember';

export default Ember.Route.extend({
  model(params) {
  	return params.page;
  }
});
import Ember from 'ember';

export default Ember.Route.extend({
  
  serializeQueryParam: function(value, urlKey, defaultValueType) {
    console.log(value);
    this._super(...arguments);
    return 20;
  },
  model(params) {
    console.log(params.page)
  	return params.page;
  }
});
import Ember from 'ember';
import config from './config/environment';

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

Router.map(function() {
  this.route('one');
  this.route('two');
});

export default Router;
import Ember from 'ember';

export default Ember.Controller.extend({
  queryParams: [
  	'page'
  ],
  page: 1
});
import Ember from 'ember';

export default Ember.Controller.extend({
  queryParams: [
  	'page'
  ],
  page: 1
});
import Ember from 'ember';

export default Ember.Controller.extend({
  appName: 'Ember Twiddle'
});