Skip to content

Instantly share code, notes, and snippets.

@abrahamspaa
Last active September 15, 2016 11:20
Show Gist options
  • Save abrahamspaa/3f180151cad1afaeea63daf28c0fea7d to your computer and use it in GitHub Desktop.
Save abrahamspaa/3f180151cad1afaeea63daf28c0fea7d to your computer and use it in GitHub Desktop.
hash-as helper check
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Component.extend({
title: "Parent title",
actions: {
hi() {
alert('Hi');
},
hello(name) {
alert("Hello" + name);
}
}
});
<h1>Parent component loaded</h1>
{{yield
(hash
title=title
sayHi=(action 'hi')
sayHello=(action 'hello')
)
}}
{{#parent-component as |title sayHi sayHello|}}
Want to access title and sayHi separately
<br/>
{{log title}}
{{log sayHi}}
I can able to access in one propertie
<br />
<br />
<br />
{{title.title}}
{{/parent-component}}
{
"version": "0.10.5",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": true,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.8.0",
"ember-data": "2.8.0",
"ember-template-compiler": "2.8.0",
"ember-testing": "2.8.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment