Select Git revision
controller.js
controller.js 3.94 KiB
/**
* Created by jeremyguiselin on 01/12/2017.
*/
(function (angular) {
"use strict";
/**
* @ngdoc controller
* @name FootballDetailsController
*
* @description
* Controller for all the predictions of a football league.
*
* @ngInject
*/
function FootballDetailsController(
$ionicHistory,
$scope,
$http,
$ionicLoading,
constantConfig
) {
/**
Scope variables
**/
$scope.locale = window.navigator.language.split('-')[0];
$scope.pictureUrl = constantConfig.imgUrl;
/**
End Scope variables
**/
/**
Static variables
**/
var self = this;
var deregistrationCallbackList = [];
/**
End Static variables
**/
/**
Scope functions
**/
$scope.myGoBack = function() {
$ionicHistory.goBack();
};
$scope.getPredictionClass = function (prediction, value) {
var percentages = [
prediction.prediction_win_first,
prediction.prediction_win_second,
prediction.prediction_draw
];
percentages.sort();
if (percentages.indexOf(value) === 2) {
return "main-prediction";
} else if (percentages.indexOf(value) === 1) {
return "second-prediction";
}
return '';
}