mirror of
https://github.com/wassname/side-by-side.git
synced 2026-09-09 11:34:24 +08:00
Update location in route service
This commit is contained in:
@@ -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 () ->
|
||||
|
||||
@@ -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('/')
|
||||
|
||||
@
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user