title: passing complex data to ng-directive
body: <p>i'm trying to build a custom directive in angular; it needs to rielaborate data passed to it before rendering the page, so in the i need to get data passed to my directive through attributes and do some stuff, and finally render the page.</p>
  
  <pre><code>.directive('lpcEdiTable', function($interpolate) {
          return {
              restrict: "E",
              templateUrl: "...",
              replace: false,
              scope: {
                  collection: "="
              },
              link: function(scope, elem, attr) {
                  //here i need to retrieve data
                  var myColl = scope.collection; //it's not working
                  //do some stuff here on myColl
                  scope.collection = myColl;
              }
          };
      });
  </code></pre>
  
  <p>so here's how i use the directive:</p>
  
  <pre><code>&lt;lpc-edi-table collection="products"&gt;&lt;/lpc-edi-table&gt;
  </code></pre>
  
  <p>where <code>products</code> is a complex object.</p>
  
  <p>in directive template i use the post elaboration data into <code>ng-repeat</code> and other stuff</p>
  
  <p>i tried to follow <a href="https://stackoverflow.com/questions/18939569/angularjs-passing-complex-data-to-directive">this</a> but i could not retrieve data into <code>link</code> function</p>