Abstract and simplify route

This commit is contained in:
Vit Brunner
2014-12-22 09:37:59 +01:00
parent 656cfe1a58
commit 0123403929
2 changed files with 10 additions and 18 deletions
+6 -1
View File
@@ -29,9 +29,14 @@ angular.module("sideBySide").service "route", ['$location', ($location) ->
return key + ":" + val.join(',')
value
@get = () ->
(property + ':' + getValue(value) \
for property, value of @params when value)
.join('/')
@update = (key, value) ->
@params[key] = value
$location.path (property + ':' + getValue(value) for property, value of @params).join('/')
$location.path @get()
@
]