UNPKG

todomvc

Version:

> Helping you select an MV\* framework

24 lines (19 loc) 472 B
/*global define */ define([ 'marionette', 'jquery' ], function (Marionette, $) { 'use strict'; return Marionette.View.extend({ initialize: function () { this.listenTo(this.collection, 'all', this.render, this); }, render: function () { this.$el = $('#clear-completed'); var completedTodos = this.collection.getCompleted(); this.$el .toggle(completedTodos.length > 0) .html('Clear completed (' + completedTodos.length + ')'); } }); });