Setting up the admin Route

Learn to set up the admin route of our e-commerce application.

The admin route contains all the products. When we click on any product, the edit route should load on the same admin.hbs template.

Setting up the admin route handler

We can set up the admin route handler and return all the products to our template in the following way:

Press + to interact
import Route from '@ember/routing/route';
import { products } from '../data/products';
export default class AdminRoute extends Route {
model(){
return products;
}
}
  • Line 2: We import products ...