我可以将条件语句放入collapse
AngularUI 的指令中吗?
我有以下设置,它有 3 个单选按钮:
<div class="controls controls-row">
<div class="btn-group" data-toggle="buttons-radio">
<button type="button" class="btn" ng-model="radioPurpose" btn-radio="'meeting'">Meeting</button>
<button type="button" class="btn" ng-model="radioPurpose" btn-radio="'tour'">Tour</button>
<button type="button" class="btn" ng-model="radioPurpose" btn-radio="'other'">Other...</button>
</div>
</div>
<div class="controls controls-row">
<textarea class="span6" placeholder="Why are you here?" ng-model="textPurpose" collapse="{{ radioPurpose == 'other' }}"></textarea>
</div>
我想textarea
根据radioPurpose
按钮的值显示/隐藏。我知道该语句true
在适当的时间进行评估,但指令始终显示textarea
.