fix(docs): async md load

This commit is contained in:
evtkhvch 2021-09-24 15:56:10 +03:00
parent e77829a465
commit 0026c02fdf
7 changed files with 73 additions and 33 deletions

View file

@ -13,7 +13,7 @@ import {
} from '@angular/core';
import { takeWhile, map } from 'rxjs/operators';
import { ActivatedRoute } from '@angular/router';
import { of as observableOf, combineLatest } from 'rxjs';
import { combineLatest, Observable } from 'rxjs';
@Component({
selector: 'ngx-page-toc',
@ -35,11 +35,11 @@ export class NgxPageTocComponent implements OnDestroy {
items: any[];
@Input()
set toc(value) {
combineLatest(
observableOf(value || []),
set toc(value: Observable<any[]>) {
combineLatest([
value,
this.activatedRoute.fragment,
)
])
.pipe(
takeWhile(() => this.alive),
map(([toc, fragment]) => {