Mark-VII
Mark-VII

Reputation: 373

Accordion in the angular 2

I am facing some problems with accordion as

this is what created in angular 2

Here A routes to one page and b to other

what i want is, i want to Accordion this A B C and D Suppose A contains Accordion as A1 A2 AND A3 and want to route that A1, A2 and A3 to other page

So please anyone provide some sample code to do this

Thank you

Upvotes: 0

Views: 144

Answers (1)

Babar Hussain
Babar Hussain

Reputation: 2905

Create routes and send data with them in component extract data from router and open appropriate tab.

https://yakovfain.com/2015/11/11/angular-2-passing-data-to-routes/

@NgModule({
 imports: [
  RouterModule.forRoot([
   { path: "", component: HomeComponent },
   { path: "A", component: Accordian, data: { open: 'A' } },
   { path: "B", component: Accordian, data: { open: 'B' } },
   { path: "C", component: Accordian, data: { open: 'C' } }
  ])
 ]
})

Upvotes: 1

Related Questions