0

I have a below table

<tr ng-repeat="r in rows">
    <td>{{$index+1}}</td>
    <td>
        <select ng-model="r.selectedObjectRowData"
            ng-options="option.apiName for option in objects"
            class="slds-select box hideOutlineClass" required="required">
                <option value=""></option>
        </select>
    </td>
    <td>
        <select ng-model="r.selectedFieldRowData"
            ng-if="r.selectedObjectRowData"
            ng-options="option.apiName for option in fields"
            class="slds-select box hideOutlineClass" required="required">
                <option value=""></option>
        </select>
    </td>
</tr>

I am trying to prepopulate the select with below data

 rows= [{"selectedValueRowData":"Outbound","selectedOperatorRowData":"Equal To","selectedObjectRowData":"Account","selectedFieldRowData":"Name","id":"xyz","filterLogic":"(1 AND 3) OR 2"}]

I get the last value in the prepopulate data but I cannot get the select drop down to have the values. Can someone tell me how Can I achieve this using angular?

3
  • I'm new to angular but why is this <option value=""></option> empty? Or that's the piece you are stuck with? Commented Apr 28, 2017 at 2:19
  • Is fields an array of objects where each object has an apiName property? Commented Apr 28, 2017 at 11:07
  • yes Keith! I figured out the issue I have to use option.apiName as option.fieldLabel for option in objects. and this did the trick. For @d_k it is to show empty default value. Commented Apr 28, 2017 at 18:41

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.