Is there a way to modify the value in a dropdown menu implemented in AngularJS using the Developer Tools Debugger?
I attempted the following code:
angular.element(
getElementsByClassName('input-group ng-pristine ng-isolate-scope ng-empty ng-invalid ng-invalid-required ng-touched')[0]
).scope().model = 'Incorrect PO'"
Unfortunately, this approach did not yield any results. Typically, when modifying Angular elements, I add the 'ng-model' attribute at the end (in the previous example, the ng-model's attribute is named 'model').
<select name="creditReason"
class="input-group ng-pristine ng-isolate-scope ng-empty ng-invalid ng-invalid-required ng-touched"
id="creditReason"
required="required"
ng-change="change ? change() : _.noop()"
ng-model="model"
ng-options="type.value as type.name for type in list"
ng-disabled="(disableField || disabled)"
ng-required="lookupRequired"
ng-attr-id="{{lookupId}}"
model="confirmDialogCtrl.creditReasonCodeId"
lookup="creditReasons"
lookup-required="true"
lookup-name="creditReason"
lookup-id="creditReason"
ng-attr-name="{{lookupName}}">
<option selected="selected" value="?"></option>
<option value="number:39001" label="Customer Request">Customer Request</option>
<option value="number:39002" label="Discount Not Applied">Discount Not Applied</option>
<option value="number:39003" label="Duplicate Billing">Duplicate Billing</option>
<option value="number:39004" label="Incorrect Address">Incorrect Address</option>
<option value="number:39005" label="Incorrect Billing Method">Incorrect Billing Method</option>
<option value="number:39006" label="Incorrect Cost Center">Incorrect Cost Center</option>
<option value="number:39007" label="Incorrect Customer/Season">Incorrect Customer/Season</option>
<option value="number:39008" label="Incorrect PO">Incorrect PO</option>
<option value="number:39009" label="Incorrect Rate">Incorrect Rate</option>
<option value="number:39010" label="Incorrect Rental Period">Incorrect Rental Period</option>
<option value="number:39011" label="Sales Tax">Sales Tax</option>
<option value="number:39012" label="Other">Other</option>
</select>
Any suggestions on how to update the value of the dropdown menu would be greatly appreciated. I am particularly confused about the part that reads:
"ng-options" = "type.value as type.name for type in list"
EDIT: Can someone provide assistance with this issue? :(
Thank you!