Vote count:
0
First of all, thanks to all who reads the Angular questions and helps the newbs like me!
Now the question.
I have a section that I pull from the Json onto the page, and I have some buttons on that page that I want to only appear for just one PART of the section, not the entire section. I would like to use ng-if for it.
The mark-up is:
<div ng-repeat="section in module.sections | filter:{'number': module.path.section}">
<h3>PART {{ section.number | number:0 }}: <strong>{{ section.name | uppercase }}</strong></h3>
<div ng-repeat="subSection in section.subSections | filter:{'number':module.path.subsection}">
<h4>{{ subSection.name | uppercase}}</h4>
<hr>
<div class="subSection">
<div ng-repeat="content in subSection.content"></div>
</div>
<div class="QuizContainer"></div>
<div ng-repeat="question in module.questions | filter:{'number':module.path.subsection}" class="questionContainer {{question.class}}"></div>
</div>
<button ng-click="validate()">Submit</button>
<button ng-show="hideRetry()" onclick="location.reload(true);">Retry Quiz</button>
<button ng-show="getCertificate()" onclick="">Print Certificate</button>
</div>
All of my web searches point to using $location or $route with it, but I'm a bit confused since I just want them to be displayed if they're in module.questions, basically.
asked 1 min ago
Using ng-if to show buttons only within a certain part of a section, not the entire section
Aucun commentaire:
Enregistrer un commentaire