Skip to content

Instantly share code, notes, and snippets.

@guftall
Created April 6, 2019 16:18
Show Gist options
  • Save guftall/7794ba4eac2f8be35c932911f4722e39 to your computer and use it in GitHub Desktop.
Save guftall/7794ba4eac2f8be35c932911f4722e39 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