Q:

keeping default route with parent route in angular

I have parent route called "Profile" and inside I have child routes like basic, company, contacts. So when I click on the parent route like Profile then by default it should show the content present in the basic component. 
export const appRoutes: Routes = [
{ path: 'profile', component: ProfileComponent,
        children: [
            {
                path: 'basic',
                component: BasicComponent,
                pathMatch: 'full'
            },
            {
                path: 'company',
                component: CompnayComponent
            },
            {
                path: 'contacts',
                component: ContactsComponent
            },
            {
                path: 'compliance',
                component: ComplianceComponent
            }
        ]
    }

So when the user clicks on Profile then automatically the content in the basic should display. So how to achieve this? Can anyone help me?

A:

add redirect to basic in your routes config:
 export const appRoutes: Routes = [
 { path: 'profile', component: ProfileComponent,
    children: [
         {
            path:'',
            redirectTo: 'basic',
            pathMatch: 'full' 
        },
        {
            path: 'basic',
            component: BasicComponent,
            pathMatch: 'full'
        },
        {
            path: 'company',
            component: CompnayComponent
        },
        {
            path: 'contacts',
            component: ContactsComponent
        },
        {
            path: 'compliance',
            component: ComplianceComponent
        }
    ]
}

