scoreboard v 0.1 we'll say

This commit is contained in:
Jason White
2017-05-05 13:12:01 -04:00
parent aeaa3cd1a2
commit 480dfe6a0a
4 changed files with 69 additions and 9 deletions

View File

@ -12,16 +12,16 @@ function($,
el:'#scoreboard',
initialize: function() {
template:ScoreboardTemplate,
this.collection = new FlagsCollection();
this.listenTo(this.collection,'reset',this.render)
this.collection.fetch({reset:true});
this.template = ScoreboardTemplate,
this.collection = new FlagsCollection();
this.listenTo(this.collection,'reset',this.render)
this.collection.fetch({reset:true});
},
render: function() {
//this.$el.html('test');
var t = _.template(this.template);
this.$el.html(t({'flags':this.collection.toJSON()}));
this.$el.html(t({'rankings':this.collection.toJSON()}));
//TODO: add template (table) to iterate over ...
//this.collection.toJSON(); << put that in the template data
//TODO: set up next poll here with listenToOnce