title: Adding elements to an array in angular2
body: <p>I would like to add elements to array . Am actually passing the values of multiple radio buttons
  This is what i have written</p>
  
  <pre><code>changeValue(params) {
  let yesvalue:any[] = [];
   let novalue:any[] = [];
  
  let param_new_name = params.value.split('-')[0];  //0 is the value which is 
                                                     //similar to yes and no radios
  if(params.value.split('-')[1] == "no"){
    novalue.push(param_new_name);
    var yes = yesvalue.indexOf(param_new_name);
    if (yes &gt; -1) {
      yesvalue.splice(yes, 1);
    }
  
  }else if(params.value.split('-')[1] == "yes") {
  
    yesvalue.push(param_new_name);
    var no = yesvalue.indexOf(param_new_name);
    if (no &gt; -1) {
      novalue.splice(no, 1);
    }
  
  }
  
  console.log(params);
  console.log("yes values are"+yesvalue); 
  console.log("no values are"+novalue);  
  </code></pre>
  
  <p>}</p>
  
  <p>A sample of the passed param contains</p>
  
  <pre><code>&lt;input type="radio" ng-reflect-value="11-no" value="11-no" 
    ng-reflect-name="new_0" name="new_0"&gt;
  </code></pre>
  
  <p>Another</p>
  
  <pre><code>&lt;input type="radio" ng-reflect-value="11-no" value="12-no" ng-reflect-name="new_0" name="new_0"&gt;  
  </code></pre>
  
  <p>The values of the radio buttons are dynamic that is they have different values which keep on changing</p>
  
  <p>eg <code>12-yes</code>, <code>13-yes</code>, <code>12-no</code></p>
  
  <p>In the bove console logs the values are always empty, where am i wrong</p>