Last active
October 28, 2015 06:42
-
-
Save mattmazzola/84acc0da7c4cf269145c to your computer and use it in GitHub Desktop.
Dockyard Article possible bug in expense-summary/component.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
actions: { | |
amountChanged() { | |
const expense = this.get(this, 'expense'); | |
//this.sendAction('update', expense); <-- Typo? Should be 'ammountChanged' instead of 'update' | |
// Everything works in the twiddle, but I think the names were changed in the article. | |
// The first argument to sendAction should be the name of the action | |
// which should match the name of the attribute | |
// From the usage in the parent template, we know this attribute is about to the update function | |
// so it's effectively going to call the expense-table's update(expense) | |
this.sendAction('amountChanged', expense); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment