Last active
July 10, 2017 12:33
-
-
Save anhkind/eba98ee33f584aa84eba7c4f33bf0005 to your computer and use it in GitHub Desktop.
nested routes of a custom outlet which use parent's template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// route definition | |
route = { | |
path: '', | |
component: CustomLayoutComponent, | |
outlet: 'custom', | |
children: [{ | |
path: 'child-route', | |
component: ChildComponent | |
}] | |
} | |
// parent layout component | |
import { Component, OnInit } from '@angular/core'; | |
@Component({ | |
template: `<router-outlet></router-outlet>` | |
}) | |
export class CustomLayoutComponent implements OnInit { | |
constructor() { } | |
ngOnInit() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment