title: Backbone Marionette: using emptyView for loading
body: <p>I am using Backbone Marionettes CollectionView. I am trying to indicate that the collection is loading, todo so I am using the emptyView to display a loader.</p>
  
  <p>However this is bad logic, because sometimes collections are empty, and therefore it becomes a broken loader.</p>
  
  <p>I tried using this script but it didnt work: <a href="https://github.com/surevine/marionette-loadingview-plugin" rel="noreferrer">https://github.com/surevine/marionette-loadingview-plugin</a></p>
  
  <p>Does anyone have a better solution? Heres my current code:</p>
  
  <pre><code>//loadingview
  define(["marionette", "text!app/templates/loading.html"], function(Marionette, Template) {
    "use strict";
    return Backbone.Marionette.ItemView.extend({
      template: Template
    });
  })
  
  //collection
  define(["marionette", "text!app/templates/events/collection.html", "app/collections/events", "app/views/events/item", 'app/views/loading'], function (Marionette, Template, Collection, Row, LoadingView) {
    "use strict"
    return Backbone.Marionette.CompositeView.extend({
      template: Template,
      itemView: Row,
      itemViewContainer: "ul",
      emptyView: LoadingView,
      initialize: function () {
        this.collection = new Collection()
        return this.collection.fetch()
      }
    })
  })
  
  //item
  define(["marionette", "text!app/templates/events/item.html"], function(Marionette, Template) {
    "use strict";
    return Backbone.Marionette.ItemView.extend({
      template: Template,
      tagName: "li"
    })
  })
  </code></pre>