Reputation: 165
I'm using angularjs 1.4.8. I'm trying to hide & show operation in <li>
.
My code is given below:
<ul class="bk_crs_rslt">
<li ng-repeat="c in courses">
<h4>
<a href="#" ng-click="show = !show"> {{c.CourseName }}
<img src="image/bk_ad_btn.jpg" />
</a>
</h4>
<p><span style="color:#337ab7;">{{c.CollegeName}}</span><br>{{c.CountryName}}</p>
<p ng-show="show">
<b>Tution Fee</b> : {{c.Fee}}<br>
<b>Level</b> : {{c.LevelName}}<br>
<b>Detail </b> : {{c.Detail}} <br>
<b>Duration </b> : {{c.Duration}}<br>
<b>Subject </b> : {{c.Subjec}}t<br>
<b>IELTS Score </b> : {{c.Score}}<br />
</p>
</li>
</ul>
How can hide & show in <li>
tag?
plunker given here
https://plnkr.co/edit/lsIypaBviXNvEi7Pwok4?p=info
its working in plunker but not working my solution?
Upvotes: 0
Views: 1000
Reputation: 25352
Try to use show as property
Like this
<ul class="bk_crs_rslt">
<li ng-repeat="c in courses" >
<h4><a href="#" ng-click="c.show = !c.show"> {{c.CourseName }}<img src="image/bk_ad_btn.jpg" /></a> </h4>
<p ng-show="c.show"><span style="color:#337ab7;">{{c.CollegeName}}</span>
<br>{{c.CountryName}}</p>
</li>
</ul>
Upvotes: 1