Skip to content

Instantly share code, notes, and snippets.

@nightire
Last active November 28, 2015 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nightire/69bdb7176c8d3e4cd5ee to your computer and use it in GitHub Desktop.
Save nightire/69bdb7176c8d3e4cd5ee to your computer and use it in GitHub Desktop.
component with targetObject?
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
notify(event) {
console.log(event)
}
}
});
<h1>Welcome to {{appName}}</h1>
{{outlet}}
{{#ice-tea as |tea|}}
<button type="button" onclick={{action "notify" target=tea}}>
Click Me
</button>
{{ice-key type="button" onclick="notify" targetObject=tea viewName="key"}}
<button type="button" {{action "notify" target=key}}>
Click Me
</button>
{{/ice-tea}}
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'button',
actions: {
notify(event) {
console.log(event)
}
}
});
Click Me
{{yield}}
{{log targetObject}}
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
notify(event) {
console.log(event)
}
}
});
{
"version": "0.4.16",
"EmberENV": {
"FEATURES": {}
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.2.0/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment