Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Angular js set default tab with ng-repeat in array object

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myCtrl">
  <div ng-repeat="obj in data">
    <ul class="nav nav-tabs">
      <li ng-class="{ active: obj1[0] && obj.selectedTab == obj1 }" ng-repeat="obj1 in obj.tab track by $index">
        <a href ng-click="setSelectedTab(obj1, obj)">{{ $index }} </a>
      </li>
    </ul>
    <div class="tab-content" ng-repeat="tab in obj.selectedTab track by $index">
      ID: {{tab.id}}<br>
      Status : {{tab.status}}
    </div>
  </div>
</div>
 
PREVIOUS NEXT
Tagged: #Angular #js #set #default #tab #array #object
ADD COMMENT
Topic
Name
9+2 =