title: Table expand & collapse not working in angular js
body: <p>Below is the tabular structure for expand &amp; collapse, i have done using table. Now i have used the below script for collapse &amp; expand. But sometime i succeeded in expand &amp; sometime don't.</p>
  
  <p>What i did, when i got response from the api, i call this function :</p>
  
  <pre><code>$timeout(function (){
                      $scope.initExpandCollapse();
                  },1000);
  
  
  $scope.initExpandCollapse = function () {
         angular.element(document).on("click", ".table_exp", function(){
               var TBODY = angular.element(this).parents(3);
          if(TBODY.hasClass("open")){
              TBODY.children("tr.expand-table-row").hide();
              TBODY.removeClass("open");
              return false;
          }
          TBODY.addClass("open");
          TBODY.children("tr.expand-table-row").show();
      });
   }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/JGxy6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JGxy6.png" alt="enter image description here"></a></p>
  
  <p>If you guys, can help me out for this problem . Thanks.</p>