mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
challenges: get Challenges (mostly) working along the same ui-router
principles as groups. Having some $scope variable resolution timing issues
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
habitrpg.controller("ChallengesCtrl", ['$scope', 'User', 'Challenges', 'Notification', '$compile', 'groups', 'challenges',
|
||||
function($scope, User, Challenges, Notification, $compile, groups, challenges) {
|
||||
habitrpg.controller("ChallengesCtrl", ['$scope', 'User', 'Challenges', 'Notification', '$compile', 'Groups',
|
||||
function($scope, User, Challenges, Notification, $compile, Groups) {
|
||||
|
||||
// groups & challenges are loaded as `resolve` via ui-router (see app.js)
|
||||
$scope.groups = groups;
|
||||
$scope.challenges = challenges;
|
||||
// FIXME get this from cache
|
||||
Groups.Group.query(function(groups){
|
||||
groups.tavern[0].name = 'Tavern';
|
||||
$scope.groups = groups.party.concat(groups.guilds).concat(groups.tavern);
|
||||
});
|
||||
// FIXME $scope.challenges needs to be resolved first (see app.js)
|
||||
$scope.challenges = Challenges.Challenge.query();
|
||||
// we should fix this, that's pretty brittle
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Challenge
|
||||
|
||||
Reference in New Issue
Block a user