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 }}
<strong>{{remaining}}</strong> item left
{{else}}
<strong>{{remaining}}</strong> items left
{{/if}}
{{#with view}}
{{#if oneLeft }}
<strong>{{entries.remaining}}</strong> item left
{{else}}
<strong>{{entries.remaining}}</strong> items left
{{/if}}
{{/with}}
......@@ -10,13 +10,13 @@ define('app/views/stats', [
*/
function( stats_html ) {
return Ember.View.extend({
entriesBinding: 'controller.namespace.entriesController',
elementId: 'todo-count',
tagName: 'span',
remainingBinding: 'controller.remaining',
template: Ember.Handlebars.compile( stats_html ),
oneLeft: function() {
return this.get( 'remaining' ) === 1;
}.observes( 'remaining' )
return this.getPath( 'entries.remaining' ) === 1;
}.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