Created
August 19, 2016 19:11
-
-
Save alexander-alvarez/1b268304df6cb3e76a81ec89e2689427 to your computer and use it in GitHub Desktop.
query params question
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
queryParams: ['param1', 'param2'], | |
param1: null, | |
param2: null, | |
actions:{ | |
change1(){ | |
this.set('param1', 'something'); | |
}, | |
change2(){ | |
this.set('param2', 'else'); | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
queryParams: { | |
param1: { | |
refreshModel: true, | |
replace: true | |
}, | |
param2: { | |
refreshModel: true, | |
replace: true | |
} | |
}, | |
model(params){ | |
if (!params.param1) { | |
params.param1 = 'something 2'; | |
} | |
if (!params.param2) { | |
params.param2 = 'else 2'; | |
} | |
return params; | |
}, | |
setupController(controller, model){ | |
controller.set('param1', model.param1); | |
controller.set('param2', model.param2); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.10.4", | |
"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.7.0", | |
"ember-data": "2.7.0", | |
"ember-template-compiler": "2.7.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment