Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save hrishikeshs/81518e9d6842ea7c99a3ece7825145dc to your computer and use it in GitHub Desktop.

Select an option

Save hrishikeshs/81518e9d6842ea7c99a3ece7825145dc to your computer and use it in GitHub Desktop.
new-one-demo-mutable-cell
import Ember from 'ember';
const { computed } = Ember;
export default Ember.Component.extend({
channels: ['california', 'bangalore'],
exampleCP: computed('record.propertyThatDoesntExistYet', function() {
return this.record.propertyThatDoesntExistYet ? 'foo' : 'bar';
}),
actions: {
click() {
console.log('clicked');
this.record.set('propertyThatDoesntExistYet', true);
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
record: Ember.Object.create({})
});
{{guided-replies-conversation-form record=record}}
<div>Hi there!</div>
<button onclick={{action 'click'}}>Click to activate CP</button>
{{#if exampleCP}}
<div> this will be displayed </div>
{{/if}}
{
"version": "0.10.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": "3.4.3",
"ember-template-compiler": "3.4.3",
"ember-cp-validations": "3.4.0",
"ember-data": "2.12.2"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment