title: Angular get form elements
body: <p>I am trying to get element name and class from a form that is passed on to a function. How can i do that?</p>
  
  <p>Html side.</p>
  
  <pre><code>   &lt;form name="test"&gt;
      &lt;div&gt;
           &lt;input type="text" class="test1" name="test2"/&gt;
      &lt;/div&gt;
      &lt;div&gt;
           &lt;input type="text" class="test3" name="test4"/&gt;
      &lt;/div&gt;
      &lt;/form&gt;
      &lt;div&gt;
           &lt;input type="button" data-ng-click="save(test)" /&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>and Javascript side</p>
  
  <pre><code>$scope.save = function(form){
     for(how many elements are there)
         (get elements values)
  }
  </code></pre>
  
  <p>how can I do that, can it even be done like that? My purpose is to change class and some other attributes when it's necessary.</p>