Searching Products in the category Route
Learn to add the product search functionality in the category route.
We'll cover the following...
We'll cover the following...
Now, let’s add a search bar in the category/index.hbs template to receive the filter value.
Adding a search bar
We need to add a search bar and set up the category.index controller to search the product in the category route. Let’s add the search bar in the app/templates/category/index.hbs template:
- Line 3–15: We add a
divof12-coland wrap our search bar in adivof9-col.- Line 8: We insert an
inputfield with the searchid. - Line 11: We create a button with the
searchclick event.
- Line 8: We insert an
Setting up the category/index controller
Next, we need to ...