File
Index
Properties
|
|
Inputs
|
|
Outputs
|
|
next
|
Type : number | null
|
Default value : null
|
|
prev
|
Type : number | null
|
Default value : null
|
|
Outputs
nextClick
|
Type : EventEmitter
|
|
prevClick
|
Type : EventEmitter
|
|
faArrowLeft
|
Default value : faArrowLeft
|
|
faArrowRight
|
Default value : faArrowRight
|
|
REGISTRY
|
Default value : REGISTRY
|
|
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { faArrowLeft, faArrowRight } from '@fortawesome/free-solid-svg-icons';
import { REGISTRY } from '../../../static/docs';
@Component({
selector: 'app-docs-nav',
templateUrl: './docs-nav.component.html',
styleUrls: ['./docs-nav.component.scss'],
})
export class DocsNavComponent {
REGISTRY = REGISTRY;
faArrowRight = faArrowRight;
faArrowLeft = faArrowLeft;
@Input() next: number | null = null;
@Input() prev: number | null = null;
@Output() nextClick = new EventEmitter();
@Output() prevClick = new EventEmitter();
}
<div class="d-flex justify-content-center align-items-center">
<div
class="item d-flex justify-content-between align-items-center w-100 px-4 py-3 mr-2"
*ngIf="prev !== null && prev >= 0"
(click)="prevClick.emit()"
>
<fa-icon [icon]="faArrowLeft"></fa-icon>
<div class="text-end">
<p class="text-muted bip mb-0">Previous</p>
<span class="h6 m-0">{{ REGISTRY[prev].title }}</span>
</div>
</div>
<div
class="item d-flex justify-content-between align-items-center w-100 px-4 py-3 ml-2"
*ngIf="next !== null && next < REGISTRY.length"
(click)="nextClick.emit()"
>
<div>
<p class="text-muted bip mb-0">Next</p>
<span class="h6 m-0">{{ REGISTRY[next].title }}</span>
</div>
<fa-icon [icon]="faArrowRight"></fa-icon>
</div>
</div>
.bip {
font-size: 10pt;
}
.item {
border-radius: 0.5rem;
border: 2px solid #ececec;
cursor: pointer;
transition: all 0.2s;
&:hover {
transition: all 0.2s;
border-color: #bfbfbf;
}
&:active {
background-color: #f4f4f4;
}
}
Legend
Html element with directive