0

I am loading different component on route match.

{
  path: '', component: MainComponent,
  children: [
    {
      path: '',
      component: ProjectComponent,
    },
    {
      path: "business/:id",
      component: BusinessComponent
    },
    {
      path: "category/:id1/:id2",
      component: CategoryComponent
    },
  ]
}

Now I need to add search route where need to show all components as per search match.

How can I show all components(ProjectComponent, BusinessComponent & CategoryComponent) together to display search result?

1 Answer 1

1

Create a new component for search results and inside this component use all of the other three components.

results template for example

<div>
  <!-- any header, page title, search input .... -->

  <app-project></app-project>
  <app-business></app-business>
  <app-category></app-category>

</div>

and pass data as inputs if needed

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.