Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tamebadger/a43a9902c9b62bfa6047d73f6991e281 to your computer and use it in GitHub Desktop.
Save tamebadger/a43a9902c9b62bfa6047d73f6991e281 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Component.extend({
domain: Ember.inject.service(),
actions: {
updateValue(){
this.get('onUpdate')()
}
}
});
import Ember from 'ember';
import UpdateMixin from '../mixins/update';
export default Ember.Controller.extend( UpdateMixin, {
domain: Ember.inject.service(),
appName: 'Ember Twiddle',
actions: {
validateFirst(){
this.get('domain').validate()
}
}
});
import Ember from 'ember';
export default Ember.Mixin.create({
updated_val: 'Empty',
actions:{
updateValue(){
var self = this;
alert(self.get('updated_val'));
self.set( 'updated_val', self.send( 'childAction' ) );
}
}
});
import Ember from 'ember';
export default Ember.Service.extend({
updated_val: 'Empty',
final_val: 'Empty',
validate(){
console.log('validate')
console.log(this.get('updated_val'))
if(this.get('updated_val') === 'Empty'){
//this.set('updated_val',
}
}
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.dialog{
border: solid 1px;
width: 300px;
height: 100px;
}
<div class='dialog'>
{{yield}}
<button {{action 'updateValue' }}> Update </button>
</div>
{
"version": "0.7.2",
"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.4.4",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js",
"ember-template-compiler": "2.4.4"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment