I have a question about updating the content of a div based on certain conditions in my code. Here is what I'm trying to achieve:
<div class="form-control" ns-show="runningImport" disabled="disabled">
{{input[row.header_safe]}}{{select[row.header_safe] != 'Add Attribute'))
</div>
<select class="form-control"
ng-model="select[row.header_safe]"
ng-options="option for option in row.options"
ng-hide="select[row.header_safe] == 'Add Attribute' || runningImport"></select>
<input class="form-control"
ng-model="input[row.header_safe]"
ng-show="select[row.header_safe] == 'Add Attribute'"
ng-hide="runningImport"
placeholder="{{inputPlaceHolders}}"
ng-required="select[row.header_safe] == 'Add Attribute'"
ng-readonly="runningImport"/>
In my code, when the <select>
has 'Add Attribute' selected, it should hide and show the input field. What I want to accomplish is updating the content of the <div>
element to display the value of the <select>
, unless it is 'Add Attribute', in which case the value of the <input>
should be shown instead.
Can anyone help me with how to achieve this functionality?