Created
January 4, 2016 12:11
-
-
Save kamilogorek/94729b1891f7b3d4d6a4 to your computer and use it in GitHub Desktop.
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.Mixin.create({ | |
serializeQueryParam(value, urlKey, defaultValueType) { | |
if (defaultValueType === 'array') { | |
return value; | |
} else { | |
return this._super.call(this, ...arguments); | |
} | |
}, | |
deserializeQueryParam(value, urlKey, defaultValueType) { | |
if (defaultValueType === 'array') { | |
return value.map(item => { | |
return parseInt(item, 10); | |
}); | |
} else { | |
return this._super.call(this, ...arguments); | |
} | |
} | |
}); |
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'; | |
import IntArraySerializer from '../../../mixins/route/int-array-serializer'; | |
export default Ember.Route.extend(IntArraySerializer, { | |
(...) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment