title: Angular 2 dragulaModel throws Cannot read property 'splice' of undefined exception
body: <p>I am using ng2-dragula and with data binding in 2 tables.  When a td is drag and drop to another table, it throws the Uncaught TypeError: Cannot read property 'splice' of undefined. and is not able to drop the element.  Need help on how to resolve this problem.</p>
  
  <p>Below is the html part</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    &lt;table class="table"&gt;
          &lt;thead class="text-primary"&gt;
              &lt;tr&gt;
                  &lt;th&gt;Task ID&lt;/th&gt;
                  &lt;th&gt;Ref #&lt;/th&gt;
                  &lt;th&gt;Customer Name&lt;/th&gt;
                  &lt;th&gt;Doc Type&lt;/th&gt;
                  &lt;th&gt;Date&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody [dragula]='"team-bag"' [dragulaModel]="tasks"&gt;
              &lt;tr *ngFor="let t of tasks"&gt;
                  &lt;td&gt;{{t.id}}&lt;/td&gt;
                  &lt;td&gt;{{t.refNbr}}&lt;/td&gt;
                  &lt;td&gt;{{t.custName}}&lt;/td&gt;
                  &lt;td&gt;{{t.docType}}&lt;/td&gt;
                  &lt;td&gt;{{t.receiveDate}}&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
      
          &lt;table class="table"&gt;
          &lt;thead class="text-primary"&gt;
              &lt;tr&gt;
                  &lt;th&gt;Task ID&lt;/th&gt;
                  &lt;th&gt;Ref #&lt;/th&gt;
                  &lt;th&gt;Customer Name&lt;/th&gt;
                  &lt;th&gt;Doc Type&lt;/th&gt;
                  &lt;th&gt;Date&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody [dragula]='"team-bag"' [dragulaModel]="agentATasks"&gt;
              &lt;tr *ngFor="let t of agentATasks"&gt;
                  &lt;td&gt;{{t.id}}&lt;/td&gt;
                  &lt;td&gt;{{t.refNbr}}&lt;/td&gt;
                  &lt;td&gt;{{t.custName}}&lt;/td&gt;
                  &lt;td&gt;{{t.docType}}&lt;/td&gt;
                  &lt;td&gt;{{t.receiveDate}}&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>tasks and agentATasks are both defined and populated in the component.ts.</p>
  
  <p>Below is the error in Chrome console.
  Subscriber.ts:241 Uncaught TypeError: Cannot read property 'splice' of undefined
      at Object.eval (<a href="http://localhost:3002/node_modules/ng2-dragula/components/dragula.provider.js:94:28" rel="nofollow noreferrer">http://localhost:3002/node_modules/ng2-dragula/components/dragula.provider.js:94:28</a>)
      at emitter (<a href="http://localhost:3002/node_modules/contra/emitter.js:47:72" rel="nofollow noreferrer">http://localhost:3002/node_modules/contra/emitter.js:47:72</a>)
      at Array.forEach (native)
      at Object.eval (<a href="http://localhost:3002/node_modules/contra/emitter.js:46:10" rel="nofollow noreferrer">http://localhost:3002/node_modules/contra/emitter.js:46:10</a>)
      at Object.thing.emit (<a href="http://localhost:3002/node_modules/contra/emitter.js:38:48" rel="nofollow noreferrer">http://localhost:3002/node_modules/contra/emitter.js:38:48</a>)
      at drop (<a href="http://localhost:3002/node_modules/dragula/dragula.js:261:13" rel="nofollow noreferrer">http://localhost:3002/node_modules/dragula/dragula.js:261:13</a>)
      at HTMLHtmlElement.release (<a href="http://localhost:3002/node_modules/dragula/dragula.js:245:7" rel="nofollow noreferrer">http://localhost:3002/node_modules/dragula/dragula.js:245:7</a>)
      at ZoneDelegate.invokeTask (<a href="http://localhost:3002/node_modules/zone.js/dist/zone.js:265:35" rel="nofollow noreferrer">http://localhost:3002/node_modules/zone.js/dist/zone.js:265:35</a>)
      at Object.onInvokeTask (<a href="http://localhost:3002/node_modules/@angular/core/bundles/core.umd.js:5967:41" rel="nofollow noreferrer">http://localhost:3002/node_modules/@angular/core/bundles/core.umd.js:5967:41</a>)
      at ZoneDelegate.invokeTask (<a href="http://localhost:3002/node_modules/zone.js/dist/zone.js:264:40" rel="nofollow noreferrer">http://localhost:3002/node_modules/zone.js/dist/zone.js:264:40</a>)</p>