gokatz
4/26/2016 - 9:02 AM

Count

Count

{
  "version": "0.7.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": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.4/ember.debug.js",
    "ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js",
    "ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.4/ember-template-compiler.js"
  }
}
<h1>Welcome to {{appName}}</h1>
<br>
{{#each arr as |item|}}
	{{incCount}}
  <br>
{{/each}}
<br>
{{outlet}}
<br>
<br>
import Ember from 'ember';

export default Ember.Controller.extend({
  appName: 'Ember Twiddle',
  arr : [1,2,3,4],
  idCount: 0,
  incCount: Ember.computed(function() {
  	this.set('idCount', (this.get('idCount')+1));
  	return `emp_level_${this.get('idCount')}`;
  })
});