Skip to content

Instantly share code, notes, and snippets.

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 tomdale/0fb1fe1f6428d554a077efe08ee017c4 to your computer and use it in GitHub Desktop.
Save tomdale/0fb1fe1f6428d554a077efe08ee017c4 to your computer and use it in GitHub Desktop.
test component helper
import Ember from 'ember';
export default Ember.Component.extend({
componentName: "inner-component",
actions: {
handleComponentChange() {
this.set('componentName', "second-component");
}
}
});
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'EmberTwiddle'
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{{yield
(hash
body=(component componentName)
)
(hash
onRename=(action "handleComponentChange")
)
}}
this is container
{{yield}}
<p>This is child componet ahah</p>
{{yield}}
<p>this is second one</p>
{{#container-component
as |subComponent actions|
}}
{{component subComponent.body}}
<button {{action actions.onRename}}>change component</button>
{{/container-component}}
{
"version": "0.15.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.1.3",
"ember-template-compiler": "3.1.3",
"ember-testing": "3.1.3"
},
"addons": {
"ember-data": "3.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment