Skip to content

Instantly share code, notes, and snippets.

@bazzel
Last active November 30, 2015 12:13
Show Gist options
  • Save bazzel/2416e3f7285fa57e5167 to your computer and use it in GitHub Desktop.
Save bazzel/2416e3f7285fa57e5167 to your computer and use it in GitHub Desktop.
{{#each starred}}
<span class="glyphicon glyphicon-star"></span>
{{/each}}
{{#each unstarred}}
<span class="glyphicon glyphicon-star-empty"></span>
{{/each}}
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'span',
starred: Ember.computed('starCount', function() {
return new Array(this.get('starCount')).fill('');
}),
unstarred: Ember.computed('starCount', function() {
return new Array(5-this.get('starCount')).fill('');
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment