added missing src files
This commit is contained in:
parent
199d66c169
commit
227226d89e
8
src/app/seconds.pipe.spec.ts
Normal file
8
src/app/seconds.pipe.spec.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import { SecondsPipe } from './seconds.pipe';
|
||||
|
||||
describe('SecondsPipe', () => {
|
||||
it('create an instance', () => {
|
||||
const pipe = new SecondsPipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
});
|
||||
16
src/app/seconds.pipe.ts
Normal file
16
src/app/seconds.pipe.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import {Pipe, PipeTransform} from '@angular/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'seconds'
|
||||
})
|
||||
export class SecondsPipe implements PipeTransform {
|
||||
|
||||
transform(value: any, args?: any): any {
|
||||
if (value) {
|
||||
return ((value / 1000) % 60).toFixed(2);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
2
src/app/timespan/timespan.component.html
Normal file
2
src/app/timespan/timespan.component.html
Normal file
@ -0,0 +1,2 @@
|
||||
<span *ngIf="prefix && theNumber">{{prefix}}</span><span class="number">{{theNumber}}</span><span class="unit" *ngIf="theNumber">{{theUnit}}</span>
|
||||
|
||||
7
src/app/timespan/timespan.component.scss
Normal file
7
src/app/timespan/timespan.component.scss
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
.unit {
|
||||
font-size: 60%;
|
||||
}
|
||||
span {
|
||||
font-family: monospace;
|
||||
}
|
||||
25
src/app/timespan/timespan.component.spec.ts
Normal file
25
src/app/timespan/timespan.component.spec.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { TimespanComponent } from './timespan.component';
|
||||
|
||||
describe('TimespanComponent', () => {
|
||||
let component: TimespanComponent;
|
||||
let fixture: ComponentFixture<TimespanComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ TimespanComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(TimespanComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
25
src/app/timespan/timespan.component.ts
Normal file
25
src/app/timespan/timespan.component.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import {Component, Input, OnInit} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-timespan',
|
||||
templateUrl: './timespan.component.html',
|
||||
styleUrls: ['./timespan.component.scss']
|
||||
})
|
||||
export class TimespanComponent implements OnInit {
|
||||
|
||||
@Input()
|
||||
prefix: string;
|
||||
|
||||
@Input()
|
||||
theNumber: number;
|
||||
|
||||
@Input()
|
||||
theUnit: string;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
15
src/app/topmenu.service.spec.ts
Normal file
15
src/app/topmenu.service.spec.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { TestBed, inject } from '@angular/core/testing';
|
||||
|
||||
import { TopmenuService } from './topmenu.service';
|
||||
|
||||
describe('TopmenuService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [TopmenuService]
|
||||
});
|
||||
});
|
||||
|
||||
it('should be created', inject([TopmenuService], (service: TopmenuService) => {
|
||||
expect(service).toBeTruthy();
|
||||
}));
|
||||
});
|
||||
39
src/app/topmenu.service.ts
Normal file
39
src/app/topmenu.service.ts
Normal file
@ -0,0 +1,39 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {BehaviorSubject} from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TopmenuService {
|
||||
|
||||
public poules$: BehaviorSubject<number[]> = new BehaviorSubject<number[]>([]);
|
||||
public tier$: BehaviorSubject<number> = new BehaviorSubject<number>(null);
|
||||
public poule$ = new BehaviorSubject<number>(null);
|
||||
public championship$ = new BehaviorSubject<number>(null);
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
setPoules(poules: number[]) {
|
||||
this.poules$.next(poules);
|
||||
}
|
||||
|
||||
setTier(tier: number) {
|
||||
console.log('setting tier...');
|
||||
if (this.tier$.value !== tier) {
|
||||
console.log('overriding tier now.');
|
||||
this.tier$.next(tier);
|
||||
}
|
||||
}
|
||||
|
||||
setPoule(poule: number) {
|
||||
if (this.poule$.value !== poule)
|
||||
this.poule$.next(poule);
|
||||
}
|
||||
|
||||
setChampionship(championship: number) {
|
||||
if (this.championship$.value !== championship)
|
||||
this.championship$.next(championship);
|
||||
}
|
||||
|
||||
}
|
||||
1
src/globals.scss
Normal file
1
src/globals.scss
Normal file
@ -0,0 +1 @@
|
||||
$reclameheight: 100px;
|
||||
Loading…
Reference in New Issue
Block a user