@dalton_moen
In Ember.js, you can trigger an event in a view by adding an action to an HTML element in your template. Here's how you can do it:
1 2 3 4 5 6 7 8 9 |
import Controller from '@ember/controller'; export default Controller.extend({ actions: { handleClick() { // Handle the event here } } }); |
1
|
<button {{action 'handleClick'}}>Click me</button> |
1
|
<button {{action 'handleClick' 'parameter'}}>Click me</button> |
This will pass the string 'parameter' to the handleClick
action.