angularjs - Using a Conditional Statement in AngularUI's Collapse Directive -
can place conditional statement collapse
directive angularui?
i have following setup, has 3 radio-style buttons:
<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 here?" ng-model="textpurpose" collapse="{{ radiopurpose == 'other' }}"></textarea> </div>
i textarea
show/hide according value of radiopurpose
buttons. know statement evaluating true
@ appropriate time, directive shows textarea
.
copied answer comment:
i haven't used angularui, i'm guessing collapse
expects expression. remove curly braces: collapse="radiopurpose == 'other'"
Comments
Post a Comment