Pooja Bajaj Dhoot
Pooja Bajaj Dhoot

Reputation: 71

ng-Show and ng-Hide Divisions on ng-repeat values

<html>
    <span ng-init="hideTableDiv = false;"></span>
    <div ng-repeat="schedule in allschedules" ng-if="(schedule.faculty_id==row.faculty_id) && (schedule.start_time)=='09:30:00'">
       <span ng-init="hideTableDiv = true;"></span>
       <span id="{{schedule.schedule_id}}" style="font-size: 88%">   

           <span class="label spanlabel" style="font-weight:100">{{schedule.classroom}}&nbsp;{{schedule.module_name}}&nbsp;{{schedule.cohort_name}}</span>
           <a id="delete_0-{{$index}}" class="" ng-click="deleteschedule(schedule.start_time,schedule.module_id,schedule.schedule_id);"><i class="fa fa-trash-o" style="color:red"></i></a>           

       </span>      
   </div>
   <div ng-if="!hideTableDiv">ALL DROPDOWN BOXES</div>
</html>

Glimpse of my code i am working on. Need to check if labeldiv is shown hide table div and vice versa.

How that can be achieved?

Upvotes: 2

Views: 34

Answers (1)

Gaurav Srivastava
Gaurav Srivastava

Reputation: 3232

do it like this:

<html>
<span ng-init="hideTableDiv = false;"></span>
<div id="labeldiv" ng-repeat="schedules in allschedules" ng-if="schedules.facultyis==row.facultyid">
<span ng-init="hideTableDiv = true;"></span>
<span>id Matches</span>
</div>

<div id="tablediv"  ng-if="!hideTableDiv">
</div>
</html>

Upvotes: 1

Related Questions