Forked from sglanzer-deprecated/controllers.application.js
Last active
October 13, 2016 05:53
-
-
Save quincyle/4bb8cabf7baaa3ae987e8ffec660dfc2 to your computer and use it in GitHub Desktop.
New Twiddle
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({ | |
queryParams: ['activeSorting'], | |
//activeSorting: 'hello', | |
// activeSoring: [], | |
activeSorting: {}, | |
actions: { | |
clickHandler() { | |
let result =[{name: 'q'}, {value: 'a'}] | |
let result2 = {name: '11'} | |
this.set('activeSorting', result2) | |
}, | |
resetHandler() { | |
//this.set('activeSorting', '') | |
// this.set('activeSorting', []) | |
this.set('activeSorting', {}) | |
} | |
} | |
}); |
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({ | |
model: function (params) { | |
console.log(params) | |
}, | |
serializeQueryParam(value, urlKey, defaultValueType) | |
{ | |
// urlKey isn't used here, but anyone overriding | |
// can use it to provide serialization specific | |
// to a certain query param. | |
if (defaultValueType === 'array') { | |
return JSON.stringify(value); | |
} | |
// only type array will trigger Json.stringify by default. | |
if (defaultValueType === 'null') { | |
return JSON.stringify(value) | |
} | |
if (defaultValueType === 'object') { | |
return JSON.stringify(value) | |
} | |
return '' + value; | |
}, | |
}); |
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.5", | |
"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.8.0", | |
"ember-data": "2.8.0", | |
"ember-template-compiler": "2.8.0", | |
"ember-testing": "2.8.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment