How do I access ng-model name assigned to each div dynamically in for loop in function which I'm calling on ng-click?
I've four divs in my page and at a time i want to display only one and hide others. I'm trying to do this using ng-show.
<div ng-show="content0">content0 details here...</div>
<div ng-show="content1">content1 details here... </div>
<div ng-show="content2">content2 details here...</div>
<div ng-show="content3">content3 details here... </div>
try:
<div ng-show="current == 0">content0 details here...</div>
<div ng-show="current == 1">content1 details here... </div>
<div ng-show="current == 2">content2 details here...</div>
<div ng-show="current == 3">content3 details here... </div>
and in ng-click set $scope.current to the one you want to show.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With