The following happens in the same controller.
I have a page that shows a list of article titles. If the user clicks on an article title a popup will show the article in detail.
The article titles are generated by a ng-repeat.
<div class="adItem" ng-click="showArticle = tiki._id" ng-repeat="tiki in tikis track by tiki._id">
The article details are also generated by a ng-repeat:
<article class="adArticle" ng-show="showArticle === tiki._id" ng-repeat="tiki in tikis track by tiki._id">
Notice i'm using ng-click
and ng-show
with the variable 'showArticle
' to toggle the visibility of the article detail. If showArticle === the id of the article title, show the article detail.
However, this doesn't work, what am i doing wrong?
thx,
Kevin,