Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 5b61ee2

Browse files
committed
Changes to support updates to the /listings page
1 parent 80d9b3c commit 5b61ee2

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

app/listings/listings.controller.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@ import angular from 'angular'
55

66
angular.module('tc.listings').controller('ListingsCtrl', ListingsCtrl)
77

8-
ListingsCtrl.$inject = ['CONSTANTS', 'logger', '$q',
8+
ListingsCtrl.$inject = ['$location', '$scope', 'CONSTANTS', 'logger', '$q',
99
'TcAuthService', 'UserService', 'UserStatsService', 'ProfileService', 'ChallengeService', 'ExternalAccountService',
1010
'ngDialog', '$anchorScroll'
1111
]
1212

13-
function ListingsCtrl(CONSTANTS, logger, $q, TcAuthService, UserService, UserStatsService, ProfileService, ChallengeService, ExternalAccountService, ngDialog, $anchorScroll) {
13+
function ListingsCtrl($location, $scope, CONSTANTS, logger, $q, TcAuthService, UserService, UserStatsService, ProfileService, ChallengeService, ExternalAccountService, ngDialog, $anchorScroll) {
1414

1515
activate()
1616

17+
$scope.listingProps = {
18+
filterFromUrl: $location.hash(),
19+
onSaveFilterToUrl: function(filter) {
20+
$location.hash(filter)
21+
}
22+
}
23+
1724
function activate() {
1825
logger.debug('Calling ListingsController activate()')
1926

app/listings/listings.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
react-component(name="ChallengeFiltersExample")
1+
react-component(name="ChallengeFiltersExample" props="listingProps")

0 commit comments

Comments
 (0)