title: How to generate JSON from table using AngularJs for saving tabular data?
body: <p>I have create one HTML with the help of AngularJS.</p>
  
  <pre><code>&lt;form name="target" ng-submit="createAllKeywordsJSON(codeMasterList)"&gt;&lt;!-- createAllKeywordsJSON() --&gt;
      &lt;input type="submit" value="Save" class="myButton" name="submit" style="margin: 0px;float:right;"&gt;
  
      &lt;div class="category-placer2" style="width:100%"&gt;
        &lt;div class="category-header-keywords"&gt;
          &lt;div class="icon-add"&gt;&lt;a href="#"&gt;&lt;img src="images/icon-add.png" alt="Add" border="0" title="Add phone Number" /&gt;&lt;/a&gt;&lt;/div&gt;
          &lt;div class="category-header-text" &gt;&lt;span ng-bind="dispName"&gt;&lt;/span&gt;&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="category-base"&gt;
          &lt;div class="keywordplacer"&gt;
  
              &lt;table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" class="keywordsList"&gt;
                  &lt;tr&gt;                
                      &lt;th width="60%" colspan="2"&gt;Code Master Name&lt;/th&gt;
                      &lt;th width="30%" colspan="2"&gt;Status&lt;/th&gt;
                  &lt;/tr&gt;
                  &lt;tr ng-repeat="type in codeMasterList"&gt;
                      &lt;td width="1%" class=""&gt;
                          &lt;input type="hidden" name="codeMasterId" value="{{type.codeMasterId}}" /&gt;
                      &lt;/td&gt;
                      &lt;td width="60%" class=""&gt;
                          &lt;input type="text" name="keywordName" value="{{type.name}}" alt="Name of Keyword" size="60" &gt;
                      &lt;/td&gt;
                      &lt;td width="30%" class=""&gt;
                          &lt;input type="radio" value="1" name="{{type.codeMasterId}}" alt="Name of Keyword" ng-checked="{{(type.activeInd == 1) &amp;&amp; ('true') || ('false')}}" /&gt;Active
                          &lt;input type="radio" value="0" name="{{type.codeMasterId}}" alt="Name of Keyword" ng-checked="{{(type.activeInd == 0) &amp;&amp; ('true') || ('false')}}" style="margin-left:50px;" /&gt;Inactive
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
  
          &lt;/div&gt;
          &lt;center&gt;
              &lt;hr style=" background-color: #ABBFC6; height: 2px; width: 90%;"&gt;
              &lt;input type="submit" value="Save" class="myButton" style="margin: 0px;"/&gt;
          &lt;/center&gt;
          &lt;!-- &lt;div class="table-index"&gt;P - Primary&lt;/div&gt; --&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>It will show value in editable mode.</p>
  
  <p>I want to save all the list at a single click on save button. how can i do such thing using angularjs ?</p>
  
  <p>Can you please help me to generate JSON data for the name as well as for radio button value ?</p>
  
  <p>below is my controller:</p>
  
  <pre><code>keywordModule.controller('keywordTypeController',['$scope', '$http', 'keywordService',
      function($scope, $http, keywordService) {
          $scope.createAllKeywordsJSON = function() {
              //alert($scope.codeMasterList.codeMasterId);
              var tempItemList = [];
              angular.foreach($scope.codeMasterList,function(item,index){
                  tempItemList.push(item);
              });
              alert(tempItemList);
              /*keywordService.createAllKeywordsJSON().query(codeMasterList,
                      //Success Handler handler
                      function(data) {
  
                      },
                      //Failure handler
                      function(error) {
  
                      }
              );*/
              //alert(codeMasterList);
          };
      }
  ]);
  </code></pre>