title: Angularjs - How to generate tables column dynamically onclick of ng-repeat element
body: <p>I'm getting such type of response from backend.</p>
  
  <pre><code> [
      {
        "id": "1",
        "name": "Roshan",
        "av": "1000",
        "compname": [
        {
          "id": "43",
          "cname": "TCS",
          "constraint_value": "",
          "details": [ {
              "id": "2",
              "emp": "Intern"
            }],
  
          "salaries": [
            {
              "id": "1",
              "monthly_value": "1000",
              "annual_value": "12000"
            }
          ]
        }
       ]
      },
  
      {
       "id": "21",
       "name": "Mohan",
       "av": "1000",
       "compname": [
          {
            "id": "143",
            "cname": "Tata Constructions",
            "constraint_value": "",
            "details": [ {
                "id": "21",
                "emp": "Expeience"
              }],
  
            "salaries": [
              {
                "id": "10",
                "monthly_value": "1000",
                "annual_value": "12000"
              }
            ]
          },
          {
            "id": "11",
            "cname": "Mahindra",
            "details": [{
                 "id": "2111",
                "emp": "Semi-skilled"
            }],
            "salaries": [
              {
                "id": "3",
                "monthly_value": "1200",
                "annual_value": "14400"
              }
            ]
          }
       ]
      }
  
  
      {
       "id": "121",
       "name": "Sohan",
       "av": "1000",
       "compname": [
         {
           "id": "453",
           "cname": "Roz Constructions",
           "constraint_value": "",
           "details": [ {
            "id": "211",
            "emp": "Fresher"
          }],
  
        "salaries": [
            {
              "id": "10",
              "monthly_value": "1000",
              "annual_value": "12000"
            }
          ]
      }
   ]
  </code></pre>
  
  <p>I am trying to create a table which will contain name. and on click of name, another column will be generated where it will show list of cname.</p>
  
  <p>I tried to achieve it but I am not getting an idea of how I can display next column based on click of name. </p>