Skip to content

Instantly share code, notes, and snippets.

@zeppelin
Created January 10, 2018 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeppelin/f673f77fe697669914cc434a8725b122 to your computer and use it in GitHub Desktop.
Save zeppelin/f673f77fe697669914cc434a8725b122 to your computer and use it in GitHub Desktop.
Handlebars nth
import Ember from 'ember';
export default Ember.Controller.extend({
m: ['a', 'b', 'c', 'd', 'e', 'f']
});
{{#each m as |item index|}}
<div>
{{item}}
{{#if (eq (mod index 2) 0)}}
!
{{/if}}
</div>
{{/each}}
{
"version": "0.13.0",
"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.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.16.3",
"ember-math-helpers": "2.4.0",
"ember-truth-helpers": "2.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment