Route gets arrays

This commit is contained in:
Vit Brunner
2014-12-19 18:40:23 +01:00
parent 6065895437
commit 6d039a8230
2 changed files with 45 additions and 14 deletions
+9 -1
View File
@@ -5,7 +5,15 @@ angular.module("sideBySide").service "route", ['$location', ($location) ->
.map (item) ->
item.split(':')
.reduce((params, param) ->
params[param[0]] = param[1]
key = param.shift()
if (param.length > 1)
value = {}
value[param[0]] = param[1].split(',')
else
value = param[0]
params[key] = value
params
, {})