diff --git a/src/app/components/leaderboards.component.html b/src/app/components/leaderboards.component.html
new file mode 100644
index 0000000..df82859
--- /dev/null
+++ b/src/app/components/leaderboards.component.html
@@ -0,0 +1,373 @@
+
+
+
+
+
+
+
+
+
+ Username |
+ Date registered |
+ Role |
+ Status |
+
+
+
+
+ Samppa Nori |
+ 2012/01/01 |
+ Member |
+
+ Active
+ |
+
+
+ Estavan Lykos |
+ 2012/02/01 |
+ Staff |
+
+ Banned
+ |
+
+
+ Chetan Mohamed |
+ 2012/02/01 |
+ Admin |
+
+ Inactive
+ |
+
+
+ Derick Maximinus |
+ 2012/03/01 |
+ Member |
+
+ Pending
+ |
+
+
+ Friderik Dávid |
+ 2012/01/21 |
+ Staff |
+
+ Active
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Username |
+ Date registered |
+ Role |
+ Status |
+
+
+
+
+ Yiorgos Avraamu |
+ 2012/01/01 |
+ Member |
+
+ Active
+ |
+
+
+ Avram Tarasios |
+ 2012/02/01 |
+ Staff |
+
+ Banned
+ |
+
+
+ Quintin Ed |
+ 2012/02/01 |
+ Admin |
+
+ Inactive
+ |
+
+
+ Enéas Kwadwo |
+ 2012/03/01 |
+ Member |
+
+ Pending
+ |
+
+
+ Agapetus Tadeáš |
+ 2012/01/21 |
+ Staff |
+
+ Active
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Username |
+ Date registered |
+ Role |
+ Status |
+
+
+
+
+ Carwyn Fachtna |
+ 2012/01/01 |
+ Member |
+
+ Active
+ |
+
+
+ Nehemiah Tatius |
+ 2012/02/01 |
+ Staff |
+
+ Banned
+ |
+
+
+ Ebbe Gemariah |
+ 2012/02/01 |
+ Admin |
+
+ Inactive
+ |
+
+
+ Eustorgios Amulius |
+ 2012/03/01 |
+ Member |
+
+ Pending
+ |
+
+
+ Leopold Gáspár |
+ 2012/01/21 |
+ Staff |
+
+ Active
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Username |
+ Date registered |
+ Role |
+ Status |
+
+
+
+
+ Pompeius René |
+ 2012/01/01 |
+ Member |
+
+ Active
+ |
+
+
+ Paĉjo Jadon |
+ 2012/02/01 |
+ Staff |
+
+ Banned
+ |
+
+
+ Micheal Mercurius |
+ 2012/02/01 |
+ Admin |
+
+ Inactive
+ |
+
+
+ Ganesha Dubhghall |
+ 2012/03/01 |
+ Member |
+
+ Pending
+ |
+
+
+ Hiroto Šimun |
+ 2012/01/21 |
+ Staff |
+
+ Active
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Username |
+ Date registered |
+ Role |
+ Status |
+
+
+
+
+ Vishnu Serghei |
+ 2012/01/01 |
+ Member |
+
+ Active
+ |
+
+
+ Zbyněk Phoibos |
+ 2012/02/01 |
+ Staff |
+
+ Banned
+ |
+
+
+ Einar Randall |
+ 2012/02/01 |
+ Admin |
+
+ Inactive
+ |
+
+
+ Félix Troels |
+ 2012/03/01 |
+ Member |
+
+ Pending
+ |
+
+
+ Aulus Agmundr |
+ 2012/01/21 |
+ Staff |
+
+ Active
+ |
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/components/leaderboards.component.ts b/src/app/components/leaderboards.component.ts
new file mode 100644
index 0000000..a28f08b
--- /dev/null
+++ b/src/app/components/leaderboards.component.ts
@@ -0,0 +1,46 @@
+import { Component } from '@angular/core';
+import { Http, Response } from '@angular/http';
+import { ApiService } from '../providers/api-service';
+import 'rxjs/add/operator/map';
+
+@Component({
+ templateUrl: 'leaderboards.component.html',
+ providers: [ApiService]
+})
+export class LeaderboardsComponent {
+
+ constructor(
+ private http: Http,
+ private formBuilder: FormBuilder,
+ private api: ApiService,
+ ) {
+ }
+
+ ngOnInit() {
+ this.api
+ // get daily total
+ .leaderboard_fetch('daily_total')
+ .subscribe(
+ result => {
+ console.log('got daily weekly leaderboard!');
+ console.log(result);
+ },
+ error => {
+ console.log( error._body );
+ }
+ );
+ this.api
+ // get daily count
+ .leaderboard_fetch('daily_count')
+ .subscribe(
+ result => {
+ console.log('got daily count leaderboard!');
+ console.log(result);
+ },
+ error => {
+ console.log( error._body );
+ }
+ );
+ }
+
+}
diff --git a/src/app/providers/api-service.ts b/src/app/providers/api-service.ts
index 79b5fc3..94ae507 100644
--- a/src/app/providers/api-service.ts
+++ b/src/app/providers/api-service.ts
@@ -74,82 +74,12 @@ export class ApiService {
// Leaderboard Api
- private leaderboard_daily_total() {
- return this.http.post(
+ public leaderboard_fetch(data) {
+ this.http.post(
this.apiUrl + '/stats/leaderboard',
{
session_key : this.sessionKey,
- type : 'daily_total'
- }
- ).map( response => response.json() );
- }
-
- private leaderboard_daily_count() {
- return this.http.post(
- this.apiUrl + '/stats/leaderboard',
- {
- session_key : this.sessionKey,
- type : 'daily_count'
- }
- ).map( response => response.json() );
- }
-
- private leaderboard_weekly_total() {
- return this.http.post(
- this.apiUrl + '/stats/leaderboard',
- {
- session_key : this.sessionKey,
- type : 'weekly_total'
- }
- ).map( response => response.json() );
- }
-
- private leaderboard_weekly_count() {
- return this.http.post(
- this.apiUrl + '/stats/leaderboard',
- {
- session_key : this.sessionKey,
- type : 'weekly_count'
- }
- ).map( response => response.json() );
- }
-
- private leaderboard_monthly_total() {
- return this.http.post(
- this.apiUrl + '/stats/leaderboard',
- {
- session_key : this.sessionKey,
- type : 'monthly_total'
- }
- ).map( response => response.json() );
- }
-
- private leaderboard_monthly_count() {
- return this.http.post(
- this.apiUrl + '/stats/leaderboard',
- {
- session_key : this.sessionKey,
- type : 'monthly_count'
- }
- ).map( response => response.json() );
- }
-
- private leaderboard_all_time_total() {
- return this.http.post(
- this.apiUrl + '/stats/leaderboard',
- {
- session_key : this.sessionKey,
- type : 'all_time_total'
- }
- ).map( response => response.json() );
- }
-
- private leaderboard_all_time_count() {
- return this.http.post(
- this.apiUrl + '/stats/leaderboard',
- {
- session_key : this.sessionKey,
- type : 'all_time_count'
+ type : data
}
).map( response => response.json() );
}