Commit 920eaf35 authored by Stas SUȘCOV's avatar Stas SUȘCOV

Update stats view bindings and force view scope (might be an Ember bug).

parent 8183459d
{{#if oneLeft }} {{#with view}}
<strong>{{remaining}}</strong> item left {{#if oneLeft }}
{{else}} <strong>{{entries.remaining}}</strong> item left
<strong>{{remaining}}</strong> items left {{else}}
{{/if}} <strong>{{entries.remaining}}</strong> items left
{{/if}}
{{/with}}
...@@ -10,13 +10,13 @@ define('app/views/stats', [ ...@@ -10,13 +10,13 @@ define('app/views/stats', [
*/ */
function( stats_html ) { function( stats_html ) {
return Ember.View.extend({ return Ember.View.extend({
entriesBinding: 'controller.namespace.entriesController',
elementId: 'todo-count', elementId: 'todo-count',
tagName: 'span', tagName: 'span',
remainingBinding: 'controller.remaining',
template: Ember.Handlebars.compile( stats_html ), template: Ember.Handlebars.compile( stats_html ),
oneLeft: function() { oneLeft: function() {
return this.get( 'remaining' ) === 1; return this.getPath( 'entries.remaining' ) === 1;
}.observes( 'remaining' ) }.property( 'entries.remaining' )
}) })
} }
); );
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment