title: angularjs : custom directive with isolated scope and passing argument
body: <p>I made a custom directive in angularjs with an isolated scope and passing argument.
  I try to check the argument in the controller/link of the directive because some times the argument is an array and i need only one item. but this don't work ( undefined object ).</p>
  
  <h2>- my directive :</h2>
  
  <pre><code>directives.directive('dir.displaytaxoname',  function () {
      return {
         restrict: 'E',
         replace: true,
         scope: {
            dfamily: '@' ,
            dgenus: '@',
            dsn: '@'               
         },
         controller: function ($scope) {
  
            console.log($scope.dsn); // empty string in the console but ok in the rendered view 
            /*function tools_isArray(arr) { return ( arr instanceof Array ); }*/
            // if the dfamily argument is an array i just want the first item 
            if(tools_isArray($scope.dfamily)){ $scope.dfamily = $scope.dfamily[0]; }
            if(tools_isArray($scope.dgenus)){ $scope.dgenus = $scope.dgenus[0]; }
            if(tools_isArray($scope.dsn)){ cl("indsn") ;  $scope.dsn = $scope.dsn[0]; }
         },
         templateUrl: "partials/elements/displaytaxoname.html"
      }
   });
  </code></pre>
  
  <h2>- my templete :</h2>
  
  <pre><code>&lt;span&gt;
      {{dfamily}}&amp;nbsp;&lt;i ng-show="dgenus!=''"&gt;{{dgenus}}&amp;nbsp;&lt;/i&gt;&lt;i&gt;{{dsn}}&lt;/i&gt;&lt;br&gt;
  &lt;/span&gt;
  </code></pre>
  
  <h2>- call to the directive :</h2>
  
  <pre><code>&lt;dir.displaytaxoname dfamily="{{specimen['T_FAMILY']}}" 
                       dgenus="{{specimen['T_GENUS']}}" 
                       dsn="{{specimen['T_SCIENTIFICNAME']}}"&gt;
  &lt;/dir.displaytaxoname&gt;
  </code></pre>
  
  <p>I try many combinaison with link/controller but don't work. 
  How can i do please ? </p>
  
  <p>thanks</p>