gokatz
2/24/2016 - 12:03 PM

setting property

setting property

{
  "version": "0.6.0",
  "EmberENV": {
    "FEATURES": {}
  },
  "options": {
    "enable-testing": false
  },
  "dependencies": {
    "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
    "ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.3.1/ember.debug.js",
    "ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.3.3/ember-data.js",
    "ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember-template-compiler.js"
  }
}
<h1>Welcome to {{appName}}</h1>
<br>
{{msg}}
<br>
{{outlet}}
<br>
<br>
import Ember from 'ember';

export default Ember.Controller.extend({
  appName: 'Ember Twiddle',
  
  msg: Em.computed(function () {
    this.getMsg();
    return this.get('msgText');
  }),
  
  getMsg : function() {
 		this.set('msgText', 'hello ');
    //this.msgText = 'hello';
  }
  
});