Skip to content

Instantly share code, notes, and snippets.

@kumkanillam
Created April 26, 2017 05:04
Show Gist options
  • Save kumkanillam/3103debaa5030038a94e08e59fe82592 to your computer and use it in GitHub Desktop.
Save kumkanillam/3103debaa5030038a94e08e59fe82592 to your computer and use it in GitHub Desktop.
New Property setting test
import Ember from 'ember';
export default Ember.Component.extend({
init(){
this._super(...arguments);
this.send('defineProps');
},
con:Ember.computed('question',function(){
return ['prop1 hi kumkanillam'];
}),
actions:{
defineProps(){
let a=this.get('con');
this.set(a[0],'-');
console.log(' thiss ',this);
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<h1>Welcome to {{appName}}</h1>
<br>
{{my-component }}
<br>
{{outlet}}
<br>
<br>
{{prop1 hi kumkanillam}}
{{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