I'm about to design an service which handles URL-Parameters in AngularJS. Currently I have two different kinds of parameters.
Single valued
¶m=myValue
Multi valued
¶m=lorem,ipsum,dolor
I'm not sure about to implement a setter for both, single and multi valued parameters…
/**
* Set parameter
*
* @param {string} name
* @param {string|array} values
* @param {boolean} multi
*/
setParam: function(name, value, multi) { }
…or if each type of parameter should get its own setter?
/**
* Set single valued parameter
*
* @param {string} name
* @param {string} value
*/
setSingleValuedParam: function(name, value) { }
/**
* Set multi valued parameter
*
* @param {string} name
* @param {array} values
*/
setMultiValuedParam: function(name, array) { }
Please note: This pseudo-code and does not work!