Created
April 6, 2019 16:18
-
-
Save guftall/7794ba4eac2f8be35c932911f4722e39 to your computer and use it in GitHub Desktop.
angular tips
This file contains 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
/* 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