title: Angular call a function in a directive from a radio button
body: <p>In the view I have a list with radio buttons.</p>
  
  <pre><code>    &lt;ul&gt;
          &lt;li ng-repeat="lyr in lyrslist | reverse"&gt;
             &lt;span&gt; {{lyr.layername}}&lt;/span&gt;
              &lt;input type="radio"
                     ngChange="setvisibility('True')"
                     ng-model="lyrname"
                     ng-value="lyr.layername"&gt;
            &lt;ul&gt;
                &lt;li ng-repeat="sublyr in lyr.sub | reverse"&gt; 
                   &lt;span&gt;{{sublyr.layername}}&lt;/span&gt;
                    &lt;input type="radio"
                           ngChange="setvisibility('True')"
                           ng-model="lyrname"
                           ng-value="sublyr.layername"&gt;
                 &lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
     &lt;/ul&gt;
  </code></pre>
  
  <p>In the directive I have this function:</p>
  
  <pre><code>scope.setvisibility = function(visibility) {   
      layer = scope.lyrname;
      console.log(layer +' '+visibility );
  };
  </code></pre>
  
  <p>How do you call the function and pass the lyrname parameter and visibility value to it?</p>