Last active
February 11, 2024 04:00
-
-
Save nfc036/00c110c26ca37a29019124f7ad46001d to your computer and use it in GitHub Desktop.
Action bubbling from components
This file contains 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({ | |
layout: Ember.computed.alias('contentTemplate'), | |
}); |
This file contains 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'; | |
import hbs from 'htmlbars-inline-precompile'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
result: '', | |
myContentTemplate: hbs('<button class="btn" {{action "testAction"}}>Click me</button>'), | |
actions: { | |
testAction() { | |
this.set('result', 'TestAction called.'); | |
} | |
} | |
}); |
This file contains 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
{ | |
"version": "0.10.5", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "release", | |
"ember-data": "2.8.0", | |
"ember-template-compiler": "release", | |
"ember-testing": "release", | |
"ember-cli-htmlbars-inline-precompile": "^0.3.5" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment