Fixed Leaderboards api and added to routing
This commit is contained in:
parent
d63a2f5e30
commit
7c55779a0f
5 changed files with 18 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { LeaderboardsComponent } from './leaderboards.component';
|
||||
import { ButtonsComponent } from './buttons.component';
|
||||
import { CardsComponent } from './cards.component';
|
||||
import { FormsComponent } from './forms.component';
|
||||
|
@ -17,6 +18,13 @@ const routes: Routes = [
|
|||
title: 'Components'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'leaderboards',
|
||||
component: LeaderboardsComponent,
|
||||
data: {
|
||||
title: 'Leaderboards'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'buttons',
|
||||
component: ButtonsComponent,
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
|
||||
// Pagesto be used in Production
|
||||
import { LeaderboardsComponent } from './leaderboards.component';
|
||||
|
||||
// Buttons Component
|
||||
import { ButtonsComponent } from './buttons.component';
|
||||
import { CardsComponent } from './cards.component';
|
||||
|
||||
|
@ -30,6 +34,7 @@ import { ComponentsRoutingModule } from './components-routing.module';
|
|||
TabsModule
|
||||
],
|
||||
declarations: [
|
||||
LeaderboardsComponent,
|
||||
ButtonsComponent,
|
||||
CardsComponent,
|
||||
FormsComponent,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import { ApiService } from '../providers/api-service';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
@ -11,7 +11,6 @@ export class LeaderboardsComponent {
|
|||
|
||||
constructor(
|
||||
private http: Http,
|
||||
private formBuilder: FormBuilder,
|
||||
private api: ApiService,
|
||||
) {
|
||||
}
|
||||
|
|
|
@ -61,6 +61,9 @@
|
|||
<li class="nav-item nav-dropdown" routerLinkActive="open" appNavDropdown>
|
||||
<a class="nav-link nav-dropdown-toggle" href="#" appNavDropdownToggle><i class="icon-puzzle"></i> Components</a>
|
||||
<ul class="nav-dropdown-items">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" routerLinkActive="active" [routerLink]="['/components/leaderboards']"><i class="icon-puzzle"></i> Leaderboards</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" routerLinkActive="active" [routerLink]="['/components/buttons']"><i class="icon-puzzle"></i> Buttons</a>
|
||||
</li>
|
||||
|
|
|
@ -75,7 +75,7 @@ export class ApiService {
|
|||
// Leaderboard Api
|
||||
|
||||
public leaderboard_fetch(data) {
|
||||
this.http.post(
|
||||
return this.http.post(
|
||||
this.apiUrl + '/stats/leaderboard',
|
||||
{
|
||||
session_key : this.sessionKey,
|
||||
|
|
Reference in a new issue