add component having a couple of configurable links, to navigate between pages

This commit is contained in:
Baptiste Lemoine 2020-04-20 18:15:30 +02:00
parent 60b4bfb619
commit da7e96526c
5 changed files with 49 additions and 0 deletions

View File

@ -57,6 +57,7 @@ import { NavigationComponent } from './ui/navigation/navigation.component';
import { LanguageComponent } from './ui/selector/language/language.component';
import { SelectorComponent } from './ui/selector/selector.component';
import { ThemeSelectorComponent } from './ui/selector/theme-selector/theme-selector.component';
import { TwoLinksComponent } from './ui/navigation/two-links/two-links.component';
export class MyMissingTranslationHandler implements MissingTranslationHandler {
handle(params: MissingTranslationHandlerParams) {
@ -106,6 +107,7 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
ThemeSelectorComponent,
MasterHeadComponent,
LanguageComponent,
TwoLinksComponent,
],
imports: [
ConfirmDialogModule,

View File

@ -0,0 +1,8 @@
<div class="two-links">
<a [routerLink]="nextRouteConfig" class="next">
C'est parfait!
</a>
<a [routerLink]="previousRouteConfig" class="prev">
Retour
</a>
</div>

View File

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

View File

@ -0,0 +1,15 @@
import { Component, Input, OnInit } from '@angular/core';
@Component({
selector: 'framadate-two-links',
templateUrl: './two-links.component.html',
styleUrls: ['./two-links.component.scss'],
})
export class TwoLinksComponent implements OnInit {
@Input() nextRouteConfig;
@Input() previousRouteConfig;
constructor() {}
ngOnInit(): void {}
}