我有一個網站,我在其中顯示不同的問題,當你點擊一個出現的答案,如果你再次點擊消失。我試圖在 角度做,但目前我無法實現它。ng-show ng-hide angular questions-answer
<ul id="question-list">
<li>
<h1><a ng-click="answer = !answer" >What is this?</a></h1>
<h3 ng-show="answer"> this</h3>
</li>
<li>
<h1 >What is the question?</h1>
<h3>It </h3>
</li>
<li>
<h1>What is the question?</h1>
<h3> Ipsum.</h3>
</li>
角碼
ehlApp.controller('faqController', function ($scope) {
$scope.answer = true;
});
什麼是您的角碼的樣子? –
$ scope.answer = true; –
整個代碼... – Naigel