Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit 07a1332

Browse files
Teamopjelbourn
authored andcommitted
fix(component-viewer): can't navigate to CDK after visiting component (#410)
1 parent 11918de commit 07a1332

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/app/pages/component-viewer/component-viewer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ export class ComponentViewer {
2828
// parent route for the section (material/cdk).
2929
combineLatest(_route.params, _route.parent.params).pipe(
3030
map((p: [Params, Params]) => ({id: p[0]['id'], section: p[1]['section']})),
31-
map(p => docItems.getItemById(p.id, p.section))).subscribe(d => {
32-
this.componentDocItem = d;
31+
map(p => ({doc: docItems.getItemById(p.id, p.section), section: p.section}))
32+
).subscribe(d => {
33+
this.componentDocItem = d.doc;
3334
if (this.componentDocItem) {
3435
this._componentPageTitle.title = `${this.componentDocItem.name}`;
3536
this.componentDocItem.examples.length ?
3637
this.sections.add('examples') :
3738
this.sections.delete('examples');
38-
3939
} else {
40-
this.router.navigate(['/components']);
40+
this.router.navigate(['/' + d.section]);
4141
}
4242
});
4343
}

0 commit comments

Comments
 (0)