mirror of
https://github.com/wassname/side-by-side.git
synced 2026-09-09 11:34:24 +08:00
Route gets arrays
This commit is contained in:
@@ -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
|
||||
, {})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user