gokatz
1/25/2016 - 9:51 AM

controller test

controller test

{
  "version": "0.5.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.2.0/ember.debug.js",
    "ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.2.0/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>
<br>
{{outlet}}

{{#if currentPlan}}
<h2>Eligible for free org</h2>
{{else}}
<h2>NOT Eligible</h2>
{{/if}}

<h1>model</h1>

{{name}}

<br>
<br>
import Ember from 'ember';

export default Ember.Controller.extend({
  currentPlan: 'trail',
  freePlan : function()
  {
    return 'success';
  }.property(),
  
  model: [{a: 'aa1'  , b: 'bb1'},{a: 'aa2',b: 'bb2'}],
  //model: {a: 'aa1', b: 'bb1'}
  fname: 'gokul',
  lname: 'kathirvel',
  name: Em.computed(function(){
    return this.get('fname') +' '+ this.get('lname')
  })
});