Skip to content

Instantly share code, notes, and snippets.

@guftall
Created April 6, 2019 16:13
Show Gist options
  • Save guftall/7e3564397bee6e3c2df92d254dfa2670 to your computer and use it in GitHub Desktop.
Save guftall/7e3564397bee6e3c2df92d254dfa2670 to your computer and use it in GitHub Desktop.
angular tips
/* angular version: "^6.1.0" */
/* navigate to child route from component method */
this.router.navigate(['/Dashboard', {outlets: { menu_Dashboard: 'Increase-Credit'}}]);
/* from html file(dashboard-component.html) that DashboardComponent rendered
* [routerLink]="[{outlets:{menu_Dashboard:['Increase-Credit']}}]"
* */
const routes: Routes = [
{ path: '', redirectTo: '/Home', pathMatch: 'full' },
{ path: 'Home', component: HomeComponent },
{ path: 'Dashboard', component: DashboardComponent, children: [
{
path: '',
component: MainDashboardComponent,
outlet: 'menu_Dashboard'
}, {
path: 'Increase-Credit',
component: IncreaseCreditComponent,
outlet: 'menu_Dashboard'
}
] }
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment