Setting up Application Controllers
Learn to set up the controllers in an Ember application.
We'll cover the following...
We'll cover the following...
Setting up the add route controller
To add a new product to the database, we need to use the controller to get product details from the add route input. First, we use the command below to create the add route:
ember g controller admin/add
This command creates an add.js file in the app/controllers/admin path. Open the add route template to define the action we want to trigger when the user clicks the “Submit” button:
In line 37, we define a click event handle named addProduct on the Submit button.
We need to ...