Skip to content

Instantly share code, notes, and snippets.

@kumkanillam
Created July 26, 2017 02:43
Show Gist options
  • Save kumkanillam/fa902a7ea9295ca4dfe4bd5cf07763cb to your computer and use it in GitHub Desktop.
Save kumkanillam/fa902a7ea9295ca4dfe4bd5cf07763cb to your computer and use it in GitHub Desktop.
import Ember from 'ember';
export default Ember.Component.extend({
actions:{
selectDate(){
console.log(' selectDate in checkout-form component');
}
}
});
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions:{
selectDateInController(){
console.log(' selectDate in controller');
}
}
});
<h1>Welcome to {{appName}}</h1>
Hi{{log 'first' this}}
<br>
{{#checkout-form as |selectDate| }}
{{!--
here context is controller not the checkout-form component
Whatever you want to access from component, then component should yield those values.
--}}
{{course-date selectDate=(action 'selectDateInController')}}
{{course-date selectDate=selectDate}}
{{/checkout-form}}
<br>
{{outlet}}
<br>
<br>
{{yield (action 'selectDate')}}
<button {{action selectDate}}> CourseDate </button>
{{yield}}
{
"version": "0.12.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-data": "2.12.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment