Update location in route service

This commit is contained in:
Vit Brunner
2014-12-17 21:40:40 +01:00
parent 6629562e6e
commit 1939e73a43
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -3,8 +3,8 @@ angular.module("sideBySide.controllers", [])
() -> null
]
.controller "ComparisonController", [
'$document', '$location', '$rootScope', '$scope', 'route', 'poems', 'transformer'
($document, $location, $rootScope, $scope, route, poems, transformer) ->
'$document', '$rootScope', '$scope', 'route', 'poems', 'transformer'
($document, $rootScope, $scope, route, poems, transformer) ->
min = 1
max = 5
@@ -18,7 +18,7 @@ angular.module("sideBySide.controllers", [])
$rootScope.$on 'duScrollspy:becameActive', ($event, $element) ->
if (not $scope.meta[0].Loading)
$location.path route.update('section', $element.prop('id').replace('section-', ''))
route.update('section', $element.prop('id').replace('section-', ''))
$rootScope.$apply()
$scope.$watchCollection () ->
+1 -1
View File
@@ -16,7 +16,7 @@ angular.module("sideBySide").service "route", ['$location', ($location) ->
@update = (key, value) ->
@params[key] = value
(property + ':' + value for property, value of @params).join('/')
$location.path (property + ':' + value for property, value of @params).join('/')
@
]