gokatz
12/23/2016 - 10:41 AM

get test 2.0.x

get test 2.0.x

{
  "version": "0.10.7",
  "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.1.2",
    "ember-data": "2.10.0",
    "ember-template-compiler": "2.1.2",
    "ember-testing": "2.1.2"
  },
  "addons": {}
}
<h1>Welcome to {{appName}}</h1>
<br>
<button {{action 'getTest'}}>GET</button>

<br>
{{outlet}}
<br>
<br>
import Ember from 'ember';

export default Ember.Controller.extend({
  appName: 'Ember Twiddle',
    obj: null,
  
  actions: {
  	getTest() {
      var obj = this.get('obj');
    	var name = Ember.get(obj, 'name');
      alert(name)
    }
  }
});