added help component, improved prediction with model templates

This commit is contained in:
VLE2FE
2020-08-20 10:42:02 +02:00
parent 9c2095c31a
commit 433572f819
25 changed files with 459 additions and 65 deletions

View File

@ -0,0 +1,14 @@
<h3>Help</h3>
<ng-container [ngSwitch]="route">
<p *ngSwitchCase="'/'">Please log in for further access. If you do not have an account yet, please contact
<a [href]="'mailto:' + d.contact">{{d.contact}}</a>.
</p>
<p *ngSwitchCase="'/home'">Please log in for further access. If you do not have an account yet, please contact
<a [href]="'mailto:' + d.contact">{{d.contact}}</a>.
</p>
<p *ngSwitchDefault>
Sadly, currently there is no help available for this page. Please contact
<a [href]="'mailto:' + d.contact">{{d.contact}}</a> for further questions.
</p>
</ng-container>

View File

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HelpComponent } from './help.component';
describe('HelpComponent', () => {
let component: HelpComponent;
let fixture: ComponentFixture<HelpComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HelpComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(HelpComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,24 @@
import { Component, OnInit } from '@angular/core';
import {Router} from '@angular/router';
import {DataService} from '../services/data.service';
@Component({
selector: 'app-help',
templateUrl: './help.component.html',
styleUrls: ['./help.component.scss']
})
export class HelpComponent implements OnInit {
route = '';
constructor(
private router: Router,
public d: DataService
) { }
ngOnInit(): void {
this.route = this.router.url.replace(/\/[0-9a-f]{24}/, ''); // remove ids
console.log(this.route);
}
}