├── src
├── assets
│ ├── .gitkeep
│ └── images
│ │ └── logo
│ │ ├── bristol.png
│ │ ├── hull-logo.png
│ │ ├── Rotherham-logo.png
│ │ ├── millwal-logo.png
│ │ ├── nottingham-logo.png
│ │ ├── derby-county-logo.png
│ │ ├── preston-north-logo.gif
│ │ ├── Brentford_FC-logo.svg
│ │ ├── bolton-logo.svg
│ │ ├── as_logo.svg
│ │ ├── norwich-logo.svg
│ │ ├── Stoke-logo.svg
│ │ └── qpr-logo.svg
├── app
│ ├── header
│ │ ├── header.component.css
│ │ ├── header.component.html
│ │ ├── header.component.ts
│ │ └── header.component.spec.ts
│ ├── footer
│ │ ├── footer.component.html
│ │ ├── footer.component.css
│ │ ├── footer.component.ts
│ │ └── footer.component.spec.ts
│ ├── app.component.css
│ ├── app.component.ts
│ ├── app.component.html
│ ├── model
│ │ └── standing.ts
│ ├── summary
│ │ ├── summary.component.css
│ │ ├── summary.component.html
│ │ ├── summary.component.spec.ts
│ │ └── summary.component.ts
│ ├── service
│ │ ├── football-data.service.spec.ts
│ │ └── football-data.service.ts
│ ├── standings
│ │ ├── standings.component.spec.ts
│ │ ├── standings.component.html
│ │ ├── standings.component.css
│ │ └── standings.component.ts
│ ├── app.module.ts
│ └── app.component.spec.ts
├── favicon.ico
├── environments
│ ├── environment.prod.ts
│ └── environment.ts
├── styles.css
├── tsconfig.app.json
├── tsconfig.spec.json
├── index.html
├── tslint.json
├── main.ts
├── browserslist
├── test.ts
├── karma.conf.js
└── polyfills.ts
├── .dockerignore
├── e2e
├── src
│ ├── app.po.ts
│ └── app.e2e-spec.ts
├── tsconfig.e2e.json
└── protractor.conf.js
├── .editorconfig
├── nginx.conf
├── Dockerfile
├── tsconfig.json
├── .gitignore
├── README.md
├── package.json
├── tslint.json
└── angular.json
/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | dist
2 | node_modules
--------------------------------------------------------------------------------
/src/app/header/header.component.css:
--------------------------------------------------------------------------------
1 | header {
2 | top: 0;
3 | width: 100%;
4 | }
--------------------------------------------------------------------------------
/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wkrzywiec/aston-villa-app/HEAD/src/favicon.ico
--------------------------------------------------------------------------------
/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/src/assets/images/logo/bristol.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wkrzywiec/aston-villa-app/HEAD/src/assets/images/logo/bristol.png
--------------------------------------------------------------------------------
/src/assets/images/logo/hull-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wkrzywiec/aston-villa-app/HEAD/src/assets/images/logo/hull-logo.png
--------------------------------------------------------------------------------
/src/assets/images/logo/Rotherham-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wkrzywiec/aston-villa-app/HEAD/src/assets/images/logo/Rotherham-logo.png
--------------------------------------------------------------------------------
/src/assets/images/logo/millwal-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wkrzywiec/aston-villa-app/HEAD/src/assets/images/logo/millwal-logo.png
--------------------------------------------------------------------------------
/src/assets/images/logo/nottingham-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wkrzywiec/aston-villa-app/HEAD/src/assets/images/logo/nottingham-logo.png
--------------------------------------------------------------------------------
/src/assets/images/logo/derby-county-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wkrzywiec/aston-villa-app/HEAD/src/assets/images/logo/derby-county-logo.png
--------------------------------------------------------------------------------
/src/assets/images/logo/preston-north-logo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wkrzywiec/aston-villa-app/HEAD/src/assets/images/logo/preston-north-logo.gif
--------------------------------------------------------------------------------
/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 | @import '~bootstrap/dist/css/bootstrap.min.css';
3 |
4 | .bg-claret {
5 | background-color: #670E36;
6 | }
--------------------------------------------------------------------------------
/src/app/footer/footer.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "types": []
6 | },
7 | "exclude": [
8 | "test.ts",
9 | "**/*.spec.ts"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/e2e/src/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo() {
5 | return browser.get('/');
6 | }
7 |
8 | getTitleText() {
9 | return element(by.css('app-root h1')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
2 | .site-container {
3 | display: flex;
4 | min-height: 100vh;
5 | flex-direction: column;
6 | }
7 |
8 | .dashboard-container {
9 | flex: 1;
10 | }
11 |
12 | .villa-info {
13 | margin-top: 50px;
14 | display: flex;
15 | }
--------------------------------------------------------------------------------
/e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "module": "commonjs",
6 | "target": "es5",
7 | "types": [
8 | "jasmine",
9 | "jasminewd2",
10 | "node"
11 | ]
12 | }
13 | }
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-root',
5 | templateUrl: './app.component.html',
6 | styleUrls: ['./app.component.css']
7 | })
8 | export class AppComponent {
9 | title = 'aston-villa-app';
10 | }
11 |
--------------------------------------------------------------------------------
/src/app/footer/footer.component.css:
--------------------------------------------------------------------------------
1 | footer {
2 | height: 50px;
3 | background-color: #95BFE5;
4 | padding-top: 10px;
5 | }
6 |
7 | a {
8 | text-decoration: none;
9 | color: #6c757d;
10 | }
11 |
12 | a:hover {
13 | text-decoration: underline;
14 | color: #6c757d;
15 | }
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/src/app/header/header.component.html:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/nginx.conf:
--------------------------------------------------------------------------------
1 | events{}
2 |
3 | http {
4 |
5 | include /etc/nginx/mime.types;
6 |
7 | server {
8 | listen 80;
9 | server_name localhost;
10 | root /usr/share/nginx/html;
11 | index index.html;
12 |
13 | location / {
14 | try_files $uri $uri/ /index.html;
15 | }
16 | }
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "types": [
6 | "jasmine",
7 | "node"
8 | ]
9 | },
10 | "files": [
11 | "test.ts",
12 | "polyfills.ts"
13 | ],
14 | "include": [
15 | "**/*.spec.ts",
16 | "**/*.d.ts"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/src/app/footer/footer.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-footer',
5 | templateUrl: './footer.component.html',
6 | styleUrls: ['./footer.component.css']
7 | })
8 | export class FooterComponent implements OnInit {
9 |
10 | constructor() { }
11 |
12 | ngOnInit() {
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/app/header/header.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-header',
5 | templateUrl: './header.component.html',
6 | styleUrls: ['./header.component.css']
7 | })
8 | export class HeaderComponent implements OnInit {
9 |
10 | constructor() { }
11 |
12 | ngOnInit() {
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | ### STAGE 1: Build ###
2 | FROM node:12.7-alpine AS build
3 | WORKDIR /usr/src/app
4 | COPY package.json package-lock.json ./
5 | RUN npm install
6 | COPY . .
7 | RUN npm run build
8 |
9 | ### STAGE 2: Run ###
10 | FROM nginx:1.17.1-alpine
11 | COPY nginx.conf /etc/nginx/nginx.conf
12 | COPY --from=build /usr/src/app/dist/aston-villa-app /usr/share/nginx/html
13 |
--------------------------------------------------------------------------------
/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/e2e/src/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 |
3 | describe('workspace-project App', () => {
4 | let page: AppPage;
5 |
6 | beforeEach(() => {
7 | page = new AppPage();
8 | });
9 |
10 | it('should display welcome message', () => {
11 | page.navigateTo();
12 | expect(page.getTitleText()).toEqual('Welcome to aston-villa-app!');
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/src/app/model/standing.ts:
--------------------------------------------------------------------------------
1 | export class Standing {
2 |
3 | team_name: String;
4 | overall_league_position: String;
5 | overall_league_payed: String;
6 | overall_league_W: String;
7 | overall_league_D: String;
8 | overall_league_L: String;
9 | overall_league_GF: String;
10 | overall_league_GA: String;
11 | overall_league_PTS: String;
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | AstonVillaApp
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/app/summary/summary.component.css:
--------------------------------------------------------------------------------
1 | .aston-villa-picture {
2 | content: url("/assets/images/logo/as_logo.svg");
3 | width: 240px;
4 | height: 240px;
5 | }
6 |
7 | div .card-body {
8 | background-color: #95BFE5;
9 | display: flex;
10 | }
11 |
12 | .av-position {
13 | color: white;
14 | font-weight: bold;
15 | }
16 |
17 | .av-last-match {
18 | color: white;
19 | }
--------------------------------------------------------------------------------
/src/app/summary/summary.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
LEAGUE POSITION:
8 | {{ position}}
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tslint.json",
3 | "rules": {
4 | "directive-selector": [
5 | true,
6 | "attribute",
7 | "app",
8 | "camelCase"
9 | ],
10 | "component-selector": [
11 | true,
12 | "element",
13 | "app",
14 | "kebab-case"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | platformBrowserDynamic().bootstrapModule(AppModule)
12 | .catch(err => console.error(err));
13 |
--------------------------------------------------------------------------------
/src/browserslist:
--------------------------------------------------------------------------------
1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
2 | # For additional information regarding the format and rule options, please see:
3 | # https://github.com/browserslist/browserslist#queries
4 | #
5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
6 |
7 | > 0.5%
8 | last 2 versions
9 | Firefox ESR
10 | not dead
11 | not IE 9-11
--------------------------------------------------------------------------------
/src/app/service/football-data.service.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { FootballDataService } from './football-data.service';
4 |
5 | describe('FootballDataService', () => {
6 | beforeEach(() => TestBed.configureTestingModule({}));
7 |
8 | it('should be created', () => {
9 | const service: FootballDataService = TestBed.get(FootballDataService);
10 | expect(service).toBeTruthy();
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "outDir": "./dist/out-tsc",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "module": "es2015",
9 | "moduleResolution": "node",
10 | "emitDecoratorMetadata": true,
11 | "experimentalDecorators": true,
12 | "importHelpers": true,
13 | "target": "es5",
14 | "typeRoots": [
15 | "node_modules/@types"
16 | ],
17 | "lib": [
18 | "es2018",
19 | "dom"
20 | ],
21 | "paths": {
22 | "jszip": [
23 | "node_modules/jszip/dist/jszip.min.js"
24 | ]
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/zone-testing';
4 | import { getTestBed } from '@angular/core/testing';
5 | import {
6 | BrowserDynamicTestingModule,
7 | platformBrowserDynamicTesting
8 | } from '@angular/platform-browser-dynamic/testing';
9 |
10 | declare const require: any;
11 |
12 | // First, initialize the Angular testing environment.
13 | getTestBed().initTestEnvironment(
14 | BrowserDynamicTestingModule,
15 | platformBrowserDynamicTesting()
16 | );
17 | // Then we find all the tests.
18 | const context = require.context('./', true, /\.spec\.ts$/);
19 | // And load the modules.
20 | context.keys().map(context);
21 |
--------------------------------------------------------------------------------
/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // This file can be replaced during build by using the `fileReplacements` array.
2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3 | // The list of file replacements can be found in `angular.json`.
4 |
5 | export const environment = {
6 | production: false
7 | };
8 |
9 | /*
10 | * For easier debugging in development mode, you can import the following file
11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12 | *
13 | * This import should be commented out in production mode because it will have a negative impact
14 | * on performance if an error is thrown.
15 | */
16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
17 |
--------------------------------------------------------------------------------
/src/app/footer/footer.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { FooterComponent } from './footer.component';
4 |
5 | describe('FooterComponent', () => {
6 | let component: FooterComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ FooterComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(FooterComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/app/header/header.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { HeaderComponent } from './header.component';
4 |
5 | describe('HeaderComponent', () => {
6 | let component: HeaderComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ HeaderComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(HeaderComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 | /out-tsc
7 |
8 | # dependencies
9 | /node_modules
10 |
11 | # profiling files
12 | chrome-profiler-events.json
13 | speed-measure-plugin.json
14 |
15 | # IDEs and editors
16 | /.idea
17 | .project
18 | .classpath
19 | .c9/
20 | *.launch
21 | .settings/
22 | *.sublime-workspace
23 |
24 | # IDE - VSCode
25 | .vscode/*
26 | !.vscode/settings.json
27 | !.vscode/tasks.json
28 | !.vscode/launch.json
29 | !.vscode/extensions.json
30 |
31 | # misc
32 | /.sass-cache
33 | /connect.lock
34 | /coverage
35 | /libpeerconnection.log
36 | npm-debug.log
37 | yarn-error.log
38 | testem.log
39 | /typings
40 |
41 | # System Files
42 | .DS_Store
43 | Thumbs.db
44 |
--------------------------------------------------------------------------------
/src/app/summary/summary.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { SummaryComponent } from './summary.component';
4 |
5 | describe('SummaryComponent', () => {
6 | let component: SummaryComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ SummaryComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(SummaryComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/app/standings/standings.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { StandingsComponent } from './standings.component';
4 |
5 | describe('StandingsComponent', () => {
6 | let component: StandingsComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ StandingsComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(StandingsComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
2 | import { BrowserModule } from '@angular/platform-browser';
3 | import { NgModule } from '@angular/core';
4 |
5 | import { AppComponent } from './app.component';
6 | import { HeaderComponent } from './header/header.component';
7 | import { FooterComponent } from './footer/footer.component';
8 | import { StandingsComponent } from './standings/standings.component';
9 | import { SummaryComponent } from './summary/summary.component';
10 |
11 | @NgModule({
12 | declarations: [
13 | AppComponent,
14 | HeaderComponent,
15 | FooterComponent,
16 | StandingsComponent,
17 | SummaryComponent
18 | ],
19 | imports: [
20 | BrowserModule,
21 | HttpClientModule
22 | ],
23 | providers: [],
24 | bootstrap: [AppComponent]
25 | })
26 | export class AppModule { }
27 |
--------------------------------------------------------------------------------
/e2e/protractor.conf.js:
--------------------------------------------------------------------------------
1 | // Protractor configuration file, see link for more information
2 | // https://github.com/angular/protractor/blob/master/lib/config.ts
3 |
4 | const { SpecReporter } = require('jasmine-spec-reporter');
5 |
6 | exports.config = {
7 | allScriptsTimeout: 11000,
8 | specs: [
9 | './src/**/*.e2e-spec.ts'
10 | ],
11 | capabilities: {
12 | 'browserName': 'chrome'
13 | },
14 | directConnect: true,
15 | baseUrl: 'http://localhost:4200/',
16 | framework: 'jasmine',
17 | jasmineNodeOpts: {
18 | showColors: true,
19 | defaultTimeoutInterval: 30000,
20 | print: function() {}
21 | },
22 | onPrepare() {
23 | require('ts-node').register({
24 | project: require('path').join(__dirname, './tsconfig.e2e.json')
25 | });
26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27 | }
28 | };
--------------------------------------------------------------------------------
/src/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | coverageIstanbulReporter: {
19 | dir: require('path').join(__dirname, '../coverage'),
20 | reports: ['html', 'lcovonly', 'text-summary'],
21 | fixWebpackSourcePaths: true
22 | },
23 | reporters: ['progress', 'kjhtml'],
24 | port: 9876,
25 | colors: true,
26 | logLevel: config.LOG_INFO,
27 | autoWatch: true,
28 | browsers: ['Chrome'],
29 | singleRun: false
30 | });
31 | };
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AstonVillaApp
2 |
3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.1.4.
4 |
5 | ## Development server
6 |
7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8 |
9 | ## Code scaffolding
10 |
11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12 |
13 | ## Build
14 |
15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
16 |
17 | ## Running unit tests
18 |
19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20 |
21 | ## Running end-to-end tests
22 |
23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24 |
25 | ## Further help
26 |
27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
28 |
--------------------------------------------------------------------------------
/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed, async } from '@angular/core/testing';
2 | import { RouterTestingModule } from '@angular/router/testing';
3 | import { AppComponent } from './app.component';
4 |
5 | describe('AppComponent', () => {
6 | beforeEach(async(() => {
7 | TestBed.configureTestingModule({
8 | imports: [
9 | RouterTestingModule
10 | ],
11 | declarations: [
12 | AppComponent
13 | ],
14 | }).compileComponents();
15 | }));
16 |
17 | it('should create the app', () => {
18 | const fixture = TestBed.createComponent(AppComponent);
19 | const app = fixture.debugElement.componentInstance;
20 | expect(app).toBeTruthy();
21 | });
22 |
23 | it(`should have as title 'aston-villa-app'`, () => {
24 | const fixture = TestBed.createComponent(AppComponent);
25 | const app = fixture.debugElement.componentInstance;
26 | expect(app.title).toEqual('aston-villa-app');
27 | });
28 |
29 | it('should render title in a h1 tag', () => {
30 | const fixture = TestBed.createComponent(AppComponent);
31 | fixture.detectChanges();
32 | const compiled = fixture.debugElement.nativeElement;
33 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to aston-villa-app!');
34 | });
35 | });
36 |
--------------------------------------------------------------------------------
/src/app/summary/summary.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { FootballDataService } from '../service/football-data.service';
3 |
4 | @Component({
5 | selector: 'app-summary',
6 | templateUrl: './summary.component.html',
7 | styleUrls: ['./summary.component.css']
8 | })
9 | export class SummaryComponent implements OnInit {
10 |
11 | position: String;
12 |
13 | constructor(private footballDataService: FootballDataService) { }
14 |
15 | ngOnInit() {
16 | this.getLeaguePosition();
17 | }
18 |
19 | getLeaguePosition(): void {
20 |
21 | this.footballDataService.retrieveAllStandings().subscribe (
22 |
23 | response => {
24 | let standings = response;
25 | let avStanding = standings.find(x => x.team_name === 'Aston Villa');
26 | if (typeof avStanding === 'undefined') {
27 | this.getTestLeaguePosition();
28 | } else {
29 | this.position = avStanding.overall_league_position;
30 | }
31 |
32 | },
33 | error => {
34 | this.getTestLeaguePosition()
35 | });
36 | }
37 |
38 | private getTestLeaguePosition(): void {
39 | let standings = this.footballDataService.retrieveTestStandings();
40 | this.position = standings.find(x => x.team_name === 'Aston Villa').overall_league_position;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/app/standings/standings.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
EFL Championship standings
4 |
5 |
6 |
7 | | No. |
8 | Team |
9 | Played |
10 | Pts |
11 | Wins |
12 | Draws |
13 | Loses |
14 | GF |
15 | GA |
16 |
17 |
18 |
19 |
20 | | {{standing.overall_league_position}} |
21 | {{standing.team_name}} |
22 | {{standing.overall_league_payed}} |
23 | {{standing.overall_league_PTS}} |
24 | {{standing.overall_league_W}} |
25 | {{standing.overall_league_D}} |
26 | {{standing.overall_league_L}} |
27 | {{standing.overall_league_GF}} |
28 | {{standing.overall_league_GA}} |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "aston-villa-app",
3 | "version": "0.0.0",
4 | "scripts": {
5 | "ng": "ng",
6 | "start": "ng serve",
7 | "build": "ng build",
8 | "test": "ng test",
9 | "lint": "ng lint",
10 | "e2e": "ng e2e"
11 | },
12 | "private": true,
13 | "dependencies": {
14 | "@angular/animations": "^7.1.4",
15 | "@angular/cdk": "^7.3.1",
16 | "@angular/common": "~7.1.0",
17 | "@angular/compiler": "~7.1.0",
18 | "@angular/core": "~7.1.0",
19 | "@angular/forms": "~7.1.0",
20 | "@angular/material": "^7.3.1",
21 | "@angular/platform-browser": "~7.1.0",
22 | "@angular/platform-browser-dynamic": "~7.1.0",
23 | "@angular/router": "~7.1.0",
24 | "bootstrap": "^4.3.1",
25 | "core-js": "^2.5.4",
26 | "rxjs": "~6.3.3",
27 | "tslib": "^1.9.0",
28 | "zone.js": "~0.8.26"
29 | },
30 | "devDependencies": {
31 | "@angular-devkit/build-angular": "~0.11.0",
32 | "@angular/cli": "~7.1.4",
33 | "@angular/compiler-cli": "~7.1.0",
34 | "@angular/language-service": "~7.1.0",
35 | "@types/node": "~8.9.4",
36 | "@types/jasmine": "~2.8.8",
37 | "@types/jasminewd2": "~2.0.3",
38 | "codelyzer": "~4.5.0",
39 | "jasmine-core": "~2.99.1",
40 | "jasmine-spec-reporter": "~4.2.1",
41 | "karma": "~3.1.1",
42 | "karma-chrome-launcher": "~2.2.0",
43 | "karma-coverage-istanbul-reporter": "~2.0.1",
44 | "karma-jasmine": "~1.1.2",
45 | "karma-jasmine-html-reporter": "^0.2.2",
46 | "protractor": "~5.4.0",
47 | "ts-node": "~7.0.0",
48 | "tslint": "~5.11.0",
49 | "typescript": "~3.1.6"
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rulesDirectory": [
3 | "codelyzer"
4 | ],
5 | "rules": {
6 | "arrow-return-shorthand": true,
7 | "callable-types": true,
8 | "class-name": true,
9 | "comment-format": [
10 | true,
11 | "check-space"
12 | ],
13 | "curly": true,
14 | "deprecation": {
15 | "severity": "warn"
16 | },
17 | "eofline": true,
18 | "forin": true,
19 | "import-blacklist": [
20 | true,
21 | "rxjs/Rx"
22 | ],
23 | "import-spacing": true,
24 | "indent": [
25 | true,
26 | "spaces"
27 | ],
28 | "interface-over-type-literal": true,
29 | "label-position": true,
30 | "max-line-length": [
31 | true,
32 | 140
33 | ],
34 | "member-access": false,
35 | "member-ordering": [
36 | true,
37 | {
38 | "order": [
39 | "static-field",
40 | "instance-field",
41 | "static-method",
42 | "instance-method"
43 | ]
44 | }
45 | ],
46 | "no-arg": true,
47 | "no-bitwise": true,
48 | "no-console": [
49 | true,
50 | "debug",
51 | "info",
52 | "time",
53 | "timeEnd",
54 | "trace"
55 | ],
56 | "no-construct": true,
57 | "no-debugger": true,
58 | "no-duplicate-super": true,
59 | "no-empty": false,
60 | "no-empty-interface": true,
61 | "no-eval": true,
62 | "no-inferrable-types": [
63 | true,
64 | "ignore-params"
65 | ],
66 | "no-misused-new": true,
67 | "no-non-null-assertion": true,
68 | "no-redundant-jsdoc": true,
69 | "no-shadowed-variable": true,
70 | "no-string-literal": false,
71 | "no-string-throw": true,
72 | "no-switch-case-fall-through": true,
73 | "no-trailing-whitespace": true,
74 | "no-unnecessary-initializer": true,
75 | "no-unused-expression": true,
76 | "no-use-before-declare": true,
77 | "no-var-keyword": true,
78 | "object-literal-sort-keys": false,
79 | "one-line": [
80 | true,
81 | "check-open-brace",
82 | "check-catch",
83 | "check-else",
84 | "check-whitespace"
85 | ],
86 | "prefer-const": true,
87 | "quotemark": [
88 | true,
89 | "single"
90 | ],
91 | "radix": true,
92 | "semicolon": [
93 | true,
94 | "always"
95 | ],
96 | "triple-equals": [
97 | true,
98 | "allow-null-check"
99 | ],
100 | "typedef-whitespace": [
101 | true,
102 | {
103 | "call-signature": "nospace",
104 | "index-signature": "nospace",
105 | "parameter": "nospace",
106 | "property-declaration": "nospace",
107 | "variable-declaration": "nospace"
108 | }
109 | ],
110 | "unified-signatures": true,
111 | "variable-name": false,
112 | "whitespace": [
113 | true,
114 | "check-branch",
115 | "check-decl",
116 | "check-operator",
117 | "check-separator",
118 | "check-type"
119 | ],
120 | "no-output-on-prefix": true,
121 | "use-input-property-decorator": true,
122 | "use-output-property-decorator": true,
123 | "use-host-property-decorator": true,
124 | "no-input-rename": true,
125 | "no-output-rename": true,
126 | "use-life-cycle-interface": true,
127 | "use-pipe-transform-interface": true,
128 | "component-class-suffix": true,
129 | "directive-class-suffix": true
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * This file includes polyfills needed by Angular and is loaded before the app.
3 | * You can add your own extra polyfills to this file.
4 | *
5 | * This file is divided into 2 sections:
6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8 | * file.
9 | *
10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13 | *
14 | * Learn more in https://angular.io/guide/browser-support
15 | */
16 |
17 | /***************************************************************************************************
18 | * BROWSER POLYFILLS
19 | */
20 |
21 | /** IE9, IE10, IE11, and Chrome <55 requires all of the following polyfills.
22 | * This also includes Android Emulators with older versions of Chrome and Google Search/Googlebot
23 | */
24 |
25 | // import 'core-js/es6/symbol';
26 | // import 'core-js/es6/object';
27 | // import 'core-js/es6/function';
28 | // import 'core-js/es6/parse-int';
29 | // import 'core-js/es6/parse-float';
30 | // import 'core-js/es6/number';
31 | // import 'core-js/es6/math';
32 | // import 'core-js/es6/string';
33 | // import 'core-js/es6/date';
34 | // import 'core-js/es6/array';
35 | // import 'core-js/es6/regexp';
36 | // import 'core-js/es6/map';
37 | // import 'core-js/es6/weak-map';
38 | // import 'core-js/es6/set';
39 |
40 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */
41 | // import 'classlist.js'; // Run `npm install --save classlist.js`.
42 |
43 | /** IE10 and IE11 requires the following for the Reflect API. */
44 | // import 'core-js/es6/reflect';
45 |
46 | /**
47 | * Web Animations `@angular/platform-browser/animations`
48 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
49 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
50 | */
51 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
52 |
53 | /**
54 | * By default, zone.js will patch all possible macroTask and DomEvents
55 | * user can disable parts of macroTask/DomEvents patch by setting following flags
56 | * because those flags need to be set before `zone.js` being loaded, and webpack
57 | * will put import in the top of bundle, so user need to create a separate file
58 | * in this directory (for example: zone-flags.ts), and put the following flags
59 | * into that file, and then add the following code before importing zone.js.
60 | * import './zone-flags.ts';
61 | *
62 | * The flags allowed in zone-flags.ts are listed here.
63 | *
64 | * The following flags will work for all browsers.
65 | *
66 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
67 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
68 | * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
69 | *
70 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
71 | * with the following flag, it will bypass `zone.js` patch for IE/Edge
72 | *
73 | * (window as any).__Zone_enable_cross_context_check = true;
74 | *
75 | */
76 |
77 | /***************************************************************************************************
78 | * Zone JS is required by default for Angular itself.
79 | */
80 | import 'zone.js/dist/zone'; // Included with Angular CLI.
81 |
82 |
83 | /***************************************************************************************************
84 | * APPLICATION IMPORTS
85 | */
86 |
--------------------------------------------------------------------------------
/src/app/standings/standings.component.css:
--------------------------------------------------------------------------------
1 | #standings-card{
2 | margin-top: 20px;
3 | margin-bottom: 20px;
4 | }
5 |
6 | #standings-title {
7 | display: flex;
8 | align-items: center;
9 | font-weight: bold;
10 | }
11 |
12 | .efl-picture {
13 | content: url("/assets/images/efl-logo.svg");
14 | width: 60px;
15 | height: 60px;
16 | }
17 |
18 | .first-place {
19 | background: rgba(84, 167, 89, 0.8);
20 | }
21 |
22 | .second-place {
23 | background: rgba(84, 167, 89, 0.6);
24 | }
25 |
26 | .third-place {
27 | background: rgba(84, 167, 89, 0.4);
28 | }
29 |
30 | .relegation-place {
31 | background: rgba(212, 111, 106, 0.6);
32 | }
33 |
34 | .team-name-column {
35 | display: flex;
36 | align-items: center;
37 | }
38 |
39 | .astonvilla-picture, .birmigham-picture, .blackburn-picture, .bolton-picture,
40 | .brentford-picture, .bristol-picture, .derby-picture, .hull-picture,
41 | .ipswich-picture, .leeds-picture, .middle-picture, .millwall-picture,
42 | .norwich-picture, .nottingham-picture, .preston-picture, .qpr-picture,
43 | .reading-picture, .rotherham-picture, .sheffield-picture, .sheffield-wednesday-picture,
44 | .stoke-picture, .swansea-picture, .wba-picture , .wigan-picture{
45 | width: 40px;
46 | height: 40px;
47 | margin-right: 5px;
48 | }
49 |
50 | .astonvilla-picture {
51 | content: url("/assets/images/logo/as_logo.svg");
52 | }
53 |
54 | .birmigham-picture {
55 | content: url("/assets/images/logo/Birmingham_City-logo.svg");
56 | }
57 |
58 | .blackburn-picture {
59 | content: url("/assets/images/logo/Blackburn_Rovers-logo.svg");
60 | }
61 |
62 | .bolton-picture {
63 | content: url("/assets/images/logo/bolton-logo.svg");
64 | }
65 |
66 | .brentford-picture {
67 | content: url("/assets/images/logo/Brentford_FC-logo.svg");
68 | }
69 |
70 | .bristol-picture {
71 | content: url("/assets/images/logo/bristol.png");
72 | }
73 |
74 | .derby-picture {
75 | content: url("/assets/images/logo/derby-county-logo.png");
76 | }
77 |
78 | .hull-picture {
79 | content: url("/assets/images/logo/hull-logo.png");
80 | }
81 |
82 | .ipswich-picture {
83 | content: url("/assets/images/logo/ipswitch.svg");
84 | }
85 |
86 | .leeds-picture {
87 | content: url("/assets/images/logo/leeds-logo.svg");
88 | }
89 |
90 | .middle-picture {
91 | content: url("/assets/images/logo/Middlesbrough-logo.svg");
92 | }
93 |
94 | .millwall-picture {
95 | content: url("/assets/images/logo/millwal-logo.png");
96 | }
97 |
98 | .norwich-picture {
99 | content: url("/assets/images/logo/norwich-logo.svg");
100 | }
101 |
102 | .nottingham-picture {
103 | content: url("/assets/images/logo/nottingham-logo.png");
104 | width: 25px;
105 | }
106 |
107 | .preston-picture {
108 | content: url("/assets/images/logo/preston-north-logo.gif");
109 | }
110 |
111 | .qpr-picture {
112 | content: url("/assets/images/logo/qpr-logo.svg");
113 | }
114 |
115 | .reading-picture {
116 | content: url("/assets/images/logo/Reading-logo.svg");
117 | }
118 |
119 | .rotherham-picture {
120 | content: url("/assets/images/logo/Rotherham-logo.png");
121 | }
122 |
123 | .sheffield-picture {
124 | content: url("/assets/images/logo/sheffield-logo.svg");
125 | }
126 |
127 | .sheffield-wednesday-picture {
128 | content: url("/assets/images/logo/Sheffield_Wednesday-logo.svg");
129 | }
130 |
131 | .stoke-picture {
132 | content: url("/assets/images/logo/Stoke-logo.svg");
133 | }
134 |
135 | .swansea-picture {
136 | content: url("/assets/images/logo/Swansea-logo.svg");
137 | }
138 |
139 | .wba-picture {
140 | content: url("/assets/images/logo/wba-logo.svg");
141 | }
142 |
143 | .wigan-picture {
144 | content: url("/assets/images/logo/wigan-logo.svg");
145 | }
146 |
147 | .points-column {
148 | font-weight: bold;
149 | }
150 |
--------------------------------------------------------------------------------
/src/app/standings/standings.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { FootballDataService } from '../service/football-data.service';
3 | import { Standing} from '../model/standing';
4 |
5 | @Component({
6 | selector: 'app-standings',
7 | templateUrl: './standings.component.html',
8 | styleUrls: ['./standings.component.css']
9 | })
10 | export class StandingsComponent implements OnInit {
11 |
12 | standings: Standing[];
13 |
14 | constructor(
15 | private footballService: FootballDataService
16 | ) { }
17 |
18 | ngOnInit() {
19 | this.retrieveAllStandings();
20 | }
21 |
22 | retrieveAllStandings():void{
23 | this.footballService.retrieveAllStandings().subscribe(
24 |
25 | response => {
26 | this.standings = response;
27 | if (!this.isAVInStandings(this.standings))
28 | this.standings = this.footballService.retrieveTestStandings();
29 | },
30 | error => {
31 | this.standings = this.footballService.retrieveTestStandings();
32 | }
33 | );
34 | }
35 |
36 | setRowColor(position): String {
37 |
38 | switch(position) {
39 |
40 | case '1': {
41 | return 'first-place';
42 | }
43 |
44 | case '2': {
45 | return 'second-place';
46 | }
47 |
48 | case '3': {
49 | return 'third-place';
50 | }
51 |
52 | case '22':
53 | case '23':
54 | case '24': {
55 | return 'relegation-place';
56 | }
57 | }
58 | }
59 |
60 | setLogo(team): String {
61 |
62 | switch(team){
63 |
64 | case 'Aston Villa': {
65 | return "astonvilla-picture";
66 | }
67 | case 'Birmingham City': {
68 | return 'birmigham-picture';
69 | }
70 |
71 | case 'Blackburn Rovers': {
72 | return 'blackburn-picture';
73 | }
74 |
75 | case 'Bolton Wanderers': {
76 | return 'bolton-picture';
77 | }
78 |
79 | case 'Brentford': {
80 | return 'brentford-picture';
81 | }
82 |
83 | case 'Bristol City': {
84 | return 'bristol-picture';
85 | }
86 |
87 | case 'Derby County': {
88 | return 'derby-picture';
89 | }
90 |
91 | case 'Hull City': {
92 | return 'hull-picture';
93 | }
94 |
95 | case 'Ipswich Town': {
96 | return 'ipswich-picture';
97 | }
98 |
99 | case 'Leeds United': {
100 | return 'leeds-picture';
101 | }
102 |
103 | case 'Middlesbrough': {
104 | return 'middle-picture';
105 | }
106 |
107 | case 'Millwall': {
108 | return 'millwall-picture';
109 | }
110 |
111 | case 'Norwich City': {
112 | return 'norwich-picture';
113 | }
114 |
115 | case 'Nottingham Forest': {
116 | return 'nottingham-picture';
117 | }
118 |
119 | case 'Preston North End': {
120 | return 'preston-picture';
121 | }
122 |
123 | case 'Queens Park Rangers': {
124 | return 'qpr-picture';
125 | }
126 |
127 | case 'Reading': {
128 | return 'reading-picture';
129 | }
130 |
131 | case 'Rotherham United': {
132 | return 'rotherham-picture';
133 | }
134 |
135 | case 'Sheffield United': {
136 | return 'sheffield-picture';
137 | }
138 |
139 | case 'Sheffield Wednesday': {
140 | return 'sheffield-wednesday-picture';
141 | }
142 |
143 | case 'Stoke City': {
144 | return 'stoke-picture';
145 | }
146 |
147 | case 'Swansea City': {
148 | return 'swansea-picture';
149 | }
150 |
151 | case 'West Bromwich Albion': {
152 | return 'wba-picture';
153 | }
154 |
155 | case 'Wigan Athletic': {
156 | return 'wigan-picture';
157 | }
158 | }
159 | }
160 |
161 | private isAVInStandings(standings: Standing[]): boolean{
162 | let avStanding = standings.find(x => x.team_name === 'Aston Villa');
163 |
164 | if (typeof avStanding === 'undefined') {
165 | return false;
166 | } else {
167 | return true;
168 | }
169 | }
170 | }
171 |
--------------------------------------------------------------------------------
/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "projects": {
6 | "aston-villa-app": {
7 | "root": "",
8 | "sourceRoot": "src",
9 | "projectType": "application",
10 | "prefix": "app",
11 | "schematics": {},
12 | "architect": {
13 | "build": {
14 | "builder": "@angular-devkit/build-angular:browser",
15 | "options": {
16 | "outputPath": "dist/aston-villa-app",
17 | "index": "src/index.html",
18 | "main": "src/main.ts",
19 | "polyfills": "src/polyfills.ts",
20 | "tsConfig": "src/tsconfig.app.json",
21 | "assets": [
22 | "src/favicon.ico",
23 | "src/assets"
24 | ],
25 | "styles": [
26 | "src/styles.css"
27 | ],
28 | "scripts": []
29 | },
30 | "configurations": {
31 | "production": {
32 | "fileReplacements": [
33 | {
34 | "replace": "src/environments/environment.ts",
35 | "with": "src/environments/environment.prod.ts"
36 | }
37 | ],
38 | "optimization": true,
39 | "outputHashing": "all",
40 | "sourceMap": false,
41 | "extractCss": true,
42 | "namedChunks": false,
43 | "aot": true,
44 | "extractLicenses": true,
45 | "vendorChunk": false,
46 | "buildOptimizer": true,
47 | "budgets": [
48 | {
49 | "type": "initial",
50 | "maximumWarning": "2mb",
51 | "maximumError": "5mb"
52 | }
53 | ]
54 | }
55 | }
56 | },
57 | "serve": {
58 | "builder": "@angular-devkit/build-angular:dev-server",
59 | "options": {
60 | "browserTarget": "aston-villa-app:build"
61 | },
62 | "configurations": {
63 | "production": {
64 | "browserTarget": "aston-villa-app:build:production"
65 | }
66 | }
67 | },
68 | "extract-i18n": {
69 | "builder": "@angular-devkit/build-angular:extract-i18n",
70 | "options": {
71 | "browserTarget": "aston-villa-app:build"
72 | }
73 | },
74 | "test": {
75 | "builder": "@angular-devkit/build-angular:karma",
76 | "options": {
77 | "main": "src/test.ts",
78 | "polyfills": "src/polyfills.ts",
79 | "tsConfig": "src/tsconfig.spec.json",
80 | "karmaConfig": "src/karma.conf.js",
81 | "styles": [
82 | "src/styles.css"
83 | ],
84 | "scripts": [],
85 | "assets": [
86 | "src/favicon.ico",
87 | "src/assets"
88 | ]
89 | }
90 | },
91 | "lint": {
92 | "builder": "@angular-devkit/build-angular:tslint",
93 | "options": {
94 | "tsConfig": [
95 | "src/tsconfig.app.json",
96 | "src/tsconfig.spec.json"
97 | ],
98 | "exclude": [
99 | "**/node_modules/**"
100 | ]
101 | }
102 | }
103 | }
104 | },
105 | "aston-villa-app-e2e": {
106 | "root": "e2e/",
107 | "projectType": "application",
108 | "prefix": "",
109 | "architect": {
110 | "e2e": {
111 | "builder": "@angular-devkit/build-angular:protractor",
112 | "options": {
113 | "protractorConfig": "e2e/protractor.conf.js",
114 | "devServerTarget": "aston-villa-app:serve"
115 | },
116 | "configurations": {
117 | "production": {
118 | "devServerTarget": "aston-villa-app:serve:production"
119 | }
120 | }
121 | },
122 | "lint": {
123 | "builder": "@angular-devkit/build-angular:tslint",
124 | "options": {
125 | "tsConfig": "e2e/tsconfig.e2e.json",
126 | "exclude": [
127 | "**/node_modules/**"
128 | ]
129 | }
130 | }
131 | }
132 | }
133 | },
134 | "defaultProject": "aston-villa-app"
135 | }
136 |
--------------------------------------------------------------------------------
/src/app/service/football-data.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { Standing} from '../model/standing';
3 | import { HttpClient} from '@angular/common/http';
4 | import { Observable } from 'rxjs';
5 |
6 | @Injectable({
7 | providedIn: 'root'
8 | })
9 | export class FootballDataService {
10 |
11 | //private standingURL = '';
12 | private standingURL = 'https://apifootball.com/api/?APIkey=9312f9173fad7330dc780c926a665525c9023c3c4433416130766a602be7c83e&action=get_standings&league_id=63';
13 |
14 | constructor(private http: HttpClient) { }
15 |
16 | retrieveAllStandings(): Observable {
17 |
18 | return this.http.get(this.standingURL);
19 | }
20 |
21 | retrieveTestStandings(): Standing[] {
22 | return [
23 | {
24 | "team_name": "Norwich City",
25 | "overall_league_position": "1",
26 | "overall_league_payed": "30",
27 | "overall_league_W": "16",
28 | "overall_league_D": "9",
29 | "overall_league_L": "5",
30 | "overall_league_GF": "57",
31 | "overall_league_GA": "39",
32 | "overall_league_PTS": "57"
33 | },
34 | {
35 | "team_name": "Leeds United",
36 | "overall_league_position": "2",
37 | "overall_league_payed": "30",
38 | "overall_league_W": "17",
39 | "overall_league_D": "6",
40 | "overall_league_L": "7",
41 | "overall_league_GF": "50",
42 | "overall_league_GA": "34",
43 | "overall_league_PTS": "57"
44 | },
45 | {
46 | "team_name": "Sheffield United",
47 | "overall_league_position": "3",
48 | "overall_league_payed": "31",
49 | "overall_league_W": "16",
50 | "overall_league_D": "7",
51 | "overall_league_L": "8",
52 | "overall_league_GF": "53",
53 | "overall_league_GA": "34",
54 | "overall_league_PTS": "55"
55 | },
56 | {
57 | "team_name": "West Bromwich Albion",
58 | "overall_league_position": "4",
59 | "overall_league_payed": "29",
60 | "overall_league_W": "14",
61 | "overall_league_D": "8",
62 | "overall_league_L": "7",
63 | "overall_league_GF": "59",
64 | "overall_league_GA": "38",
65 | "overall_league_PTS": "50"
66 | },
67 | {
68 | "team_name": "Middlesbrough",
69 | "overall_league_position": "5",
70 | "overall_league_payed": "29",
71 | "overall_league_W": "13",
72 | "overall_league_D": "11",
73 | "overall_league_L": "5",
74 | "overall_league_GF": "34",
75 | "overall_league_GA": "22",
76 | "overall_league_PTS": "50"
77 | },
78 | {
79 | "team_name": "Bristol City",
80 | "overall_league_position": "6",
81 | "overall_league_payed": "29",
82 | "overall_league_W": "13",
83 | "overall_league_D": "8",
84 | "overall_league_L": "8",
85 | "overall_league_GF": "37",
86 | "overall_league_GA": "29",
87 | "overall_league_PTS": "47"
88 | },
89 | {
90 | "team_name": "Derby County",
91 | "overall_league_position": "7",
92 | "overall_league_payed": "29",
93 | "overall_league_W": "13",
94 | "overall_league_D": "8",
95 | "overall_league_L": "8",
96 | "overall_league_GF": "40",
97 | "overall_league_GA": "35",
98 | "overall_league_PTS": "47"
99 | },
100 | {
101 | "team_name": "Aston Villa",
102 | "overall_league_position": "8",
103 | "overall_league_payed": "31",
104 | "overall_league_W": "10",
105 | "overall_league_D": "14",
106 | "overall_league_L": "7",
107 | "overall_league_GF": "56",
108 | "overall_league_GA": "49",
109 | "overall_league_PTS": "44"
110 | },
111 | {
112 | "team_name": "Birmingham City",
113 | "overall_league_position": "9",
114 | "overall_league_payed": "30",
115 | "overall_league_W": "10",
116 | "overall_league_D": "13",
117 | "overall_league_L": "7",
118 | "overall_league_GF": "45",
119 | "overall_league_GA": "36",
120 | "overall_league_PTS": "43"
121 | },
122 | {
123 | "team_name": "Hull City",
124 | "overall_league_position": "10",
125 | "overall_league_payed": "30",
126 | "overall_league_W": "12",
127 | "overall_league_D": "7",
128 | "overall_league_L": "11",
129 | "overall_league_GF": "43",
130 | "overall_league_GA": "38",
131 | "overall_league_PTS": "43"
132 | },
133 | {
134 | "team_name": "Blackburn Rovers",
135 | "overall_league_position": "11",
136 | "overall_league_payed": "30",
137 | "overall_league_W": "11",
138 | "overall_league_D": "10",
139 | "overall_league_L": "9",
140 | "overall_league_GF": "42",
141 | "overall_league_GA": "46",
142 | "overall_league_PTS": "43"
143 | },
144 | {
145 | "team_name": "Nottingham Forest",
146 | "overall_league_position": "12",
147 | "overall_league_payed": "30",
148 | "overall_league_W": "10",
149 | "overall_league_D": "12",
150 | "overall_league_L": "8",
151 | "overall_league_GF": "42",
152 | "overall_league_GA": "35",
153 | "overall_league_PTS": "42"
154 | },
155 | {
156 | "team_name": "Swansea City",
157 | "overall_league_position": "13",
158 | "overall_league_payed": "30",
159 | "overall_league_W": "11",
160 | "overall_league_D": "8",
161 | "overall_league_L": "11",
162 | "overall_league_GF": "40",
163 | "overall_league_GA": "37",
164 | "overall_league_PTS": "41"
165 | },
166 | {
167 | "team_name": "Queens Park Rangers",
168 | "overall_league_position": "14",
169 | "overall_league_payed": "29",
170 | "overall_league_W": "11",
171 | "overall_league_D": "6",
172 | "overall_league_L": "12",
173 | "overall_league_GF": "35",
174 | "overall_league_GA": "41",
175 | "overall_league_PTS": "39"
176 | },
177 | {
178 | "team_name": "Stoke City",
179 | "overall_league_position": "15",
180 | "overall_league_payed": "30",
181 | "overall_league_W": "9",
182 | "overall_league_D": "11",
183 | "overall_league_L": "10",
184 | "overall_league_GF": "33",
185 | "overall_league_GA": "39",
186 | "overall_league_PTS": "38"
187 | },
188 | {
189 | "team_name": "Sheffield Wednesday",
190 | "overall_league_position": "16",
191 | "overall_league_payed": "29",
192 | "overall_league_W": "10",
193 | "overall_league_D": "8",
194 | "overall_league_L": "11",
195 | "overall_league_GF": "34",
196 | "overall_league_GA": "45",
197 | "overall_league_PTS": "38"
198 | },
199 | {
200 | "team_name": "Brentford",
201 | "overall_league_position": "17",
202 | "overall_league_payed": "29",
203 | "overall_league_W": "9",
204 | "overall_league_D": "10",
205 | "overall_league_L": "10",
206 | "overall_league_GF": "48",
207 | "overall_league_GA": "41",
208 | "overall_league_PTS": "37"
209 | },
210 | {
211 | "team_name": "Preston North End",
212 | "overall_league_position": "18",
213 | "overall_league_payed": "30",
214 | "overall_league_W": "9",
215 | "overall_league_D": "10",
216 | "overall_league_L": "11",
217 | "overall_league_GF": "45",
218 | "overall_league_GA": "45",
219 | "overall_league_PTS": "37"
220 | },
221 | {
222 | "team_name": "Wigan Athletic",
223 | "overall_league_position": "19",
224 | "overall_league_payed": "30",
225 | "overall_league_W": "9",
226 | "overall_league_D": "5",
227 | "overall_league_L": "16",
228 | "overall_league_GF": "31",
229 | "overall_league_GA": "45",
230 | "overall_league_PTS": "32"
231 | },
232 | {
233 | "team_name": "Millwall",
234 | "overall_league_position": "20",
235 | "overall_league_payed": "29",
236 | "overall_league_W": "7",
237 | "overall_league_D": "9",
238 | "overall_league_L": "13",
239 | "overall_league_GF": "34",
240 | "overall_league_GA": "44",
241 | "overall_league_PTS": "30"
242 | },
243 | {
244 | "team_name": "Rotherham United",
245 | "overall_league_position": "21",
246 | "overall_league_payed": "30",
247 | "overall_league_W": "5",
248 | "overall_league_D": "11",
249 | "overall_league_L": "14",
250 | "overall_league_GF": "28",
251 | "overall_league_GA": "48",
252 | "overall_league_PTS": "26"
253 | },
254 | {
255 | "team_name": "Reading",
256 | "overall_league_position": "22",
257 | "overall_league_payed": "30",
258 | "overall_league_W": "5",
259 | "overall_league_D": "10",
260 | "overall_league_L": "15",
261 | "overall_league_GF": "32",
262 | "overall_league_GA": "44",
263 | "overall_league_PTS": "25"
264 | },
265 | {
266 | "team_name": "Bolton Wanderers",
267 | "overall_league_position": "23",
268 | "overall_league_payed": "30",
269 | "overall_league_W": "5",
270 | "overall_league_D": "8",
271 | "overall_league_L": "17",
272 | "overall_league_GF": "19",
273 | "overall_league_GA": "45",
274 | "overall_league_PTS": "23"
275 | },
276 | {
277 | "team_name": "Ipswich Town",
278 | "overall_league_position": "24",
279 | "overall_league_payed": "30",
280 | "overall_league_W": "3",
281 | "overall_league_D": "9",
282 | "overall_league_L": "18",
283 | "overall_league_GF": "23",
284 | "overall_league_GA": "51",
285 | "overall_league_PTS": "18"
286 | }
287 | ]
288 | }
289 |
290 | }
291 |
--------------------------------------------------------------------------------
/src/assets/images/logo/Brentford_FC-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/assets/images/logo/bolton-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
184 |
--------------------------------------------------------------------------------
/src/assets/images/logo/as_logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
104 |
--------------------------------------------------------------------------------
/src/assets/images/logo/norwich-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
166 |
--------------------------------------------------------------------------------
/src/assets/images/logo/Stoke-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/assets/images/logo/qpr-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------