You need to sign in to do that
Don't have an account?
Connect Components with Events -- Instructions out of order
It looks to me like the insructions on part of this trail are out of order. About halfway down you are creating the "handleCreateExpense" action handler. These are the instructions:
It tells us to put it under the "handleCreateExpense" handler, but we haven't created that one yet. The instructions to create it are further down in the instructions. About another quarter of the way through we finally get to this:
We’ll start with the handleUpdateExpense action handler. Here’s the code, and be sure to put it riiiiiight under the handleCreateExpense action handler.
It tells us to put it under the "handleCreateExpense" handler, but we haven't created that one yet. The instructions to create it are further down in the instructions. About another quarter of the way through we finally get to this:
Finally, for the last step, create the handleCreateExpense action handler in the expenses controller. Add this code right above or below the handleUpdateExpense action handler.
Wanted to share since it caught me up for a bit. Thought I had missed something in an earlier trail and went searching for it.
Firstly thanks a lot for your interest on trail head.
Appreciate your post.May I suggest you send feedback on this by clicking on submit feedback button on the same page of the module so that trailhead team would get noticed and do the appropriate.
Thanks,
Nagendra.
expensesApp.app (this is my harness app, your name may vary)
expenses.cmp
expensesController.js (I have included some console.log lines throughout my js that I used in debugging. These aren't required.)
expensesHelper.js
expensesList.cmp - this is the mark-up for the list of expenses at the bottom of the expenses.cmp, below the new expense form. Key feature is the aura:iteration tag, which repeatedly uses the expensesItem markup that follows.
expenseItem.cmp - this is the markup for each individual expense item, called in the iteration on expensesList.cmp.
expensesForm.cmp - this is the markup for the new expense form. NOTE the aura:registerEvent line just below the newExpense attribute. That's essential for broadcasting the createExpense event.
expenseFormController.js - I added some code to clear the expense form after submitting a new expense.
expenseFormHelpeer.js
expenseForm.css - fixes the datePicker position
ExpensesController.apxc - note the filename of this APEX controller has a capital E, in comparison to the javascript controller called expensesController.js. This appears to be a naming convention that is useful if you notice it.
expensesItemUpdate.evt - this one event is used by both updateExpense and createExpense, but requires two separate aura:handlers with different names to catch the two events.
expenseItemController.js