title: passing attribute of element to a function in angular 4/5
body: <p>I want to pass attribute values of elements to a function at a button click and here's how i am doing it</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;div&gt;
    &lt;ul #list&gt;
      &lt;li class="radio" *ngFor="let option of options; let j = index" id={{i}}-{{j}} #item&gt;
        &lt;label&gt;&lt;input type="radio" #opt  name={{i}} value={{option}} /&gt; {{option}} &lt;/label&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;button type="button" (click)='func(opt.value, item.id, list)'&gt;submit&lt;/button&gt;
     </code></pre>
  </div>
  </div>
  </p>
  
  <p>what i am doing here is  </p>
  
  <ol>
  <li>I am passing the value of radio button(first arg)</li>
  <li>passing the id of the list item(second arg)</li>
  <li>passing the reference of the entire list (third arg)</li>
  </ol>
  
  <p>But of course it's not working the error message says cannot read value of undefined(first arg) and I suspect the same will happen for the rest of the argument as well. </p>
  
  <p>So my question is how do i pass the attribute value to the function?</p>
  
  <p>PS: I am new to angular stuff</p>