Skip to content

Commit

Permalink
fix(component-viewer): can't navigate to CDK after visiting component (
Browse files Browse the repository at this point in the history
  • Loading branch information
Teamop authored and jelbourn committed Mar 14, 2018
1 parent 11918de commit 07a1332
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/pages/component-viewer/component-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ export class ComponentViewer {
// parent route for the section (material/cdk).
combineLatest(_route.params, _route.parent.params).pipe(
map((p: [Params, Params]) => ({id: p[0]['id'], section: p[1]['section']})),
map(p => docItems.getItemById(p.id, p.section))).subscribe(d => {
this.componentDocItem = d;
map(p => ({doc: docItems.getItemById(p.id, p.section), section: p.section}))
).subscribe(d => {
this.componentDocItem = d.doc;
if (this.componentDocItem) {
this._componentPageTitle.title = `${this.componentDocItem.name}`;
this.componentDocItem.examples.length ?
this.sections.add('examples') :
this.sections.delete('examples');

} else {
this.router.navigate(['/components']);
this.router.navigate(['/' + d.section]);
}
});
}
Expand Down

0 comments on commit 07a1332

Please sign in to comment.