Get incoming links number for graph element in jointJS
<p>In jointJS I want for every element to check the number of incoming connected links.So this is the code I made according to documentation but it doesn't work:</p>

<pre><code> _.each(this.graph.getElements(), function(element) {

    var inboundLinksCount = this.graph.getConnectedLinks(element, {inbound: true}).length;
    alert(inboundLinksCount); 
    }
</code></pre>

<p>This is the documentation of <code>getConnectedLinks</code> in jointJS:
<a href="http://resources.jointjs.com/docs/jointjs/v1.0/joint.html#dia.Graph.prototype.getConnectedLinks" rel="nofollow">http://resources.jointjs.com/docs/jointjs/v1.0/joint.html#dia.Graph.prototype.getConnectedLinks</a></p>

<p>Any ideas please?</p>