Prometheus Prometheus -4 years ago 101
AngularJS Question

AngularJS: select is not updating the HTML view

I've encountered a problem about the AngularJS's select option tag.

I'm trying to pass the

values to AngularJS's select tag, to use them in a dropdown list from Java. Looks like it is working fine. The problem is, when I select a value from that list, it is not updating the HTML side, and showing me the selected one.

I don't think it is related to the code I've written already, because of it is filling the list correctly. I think it can be related to the built-in functions of Angular.

Below one is my HTML side of code:

<div class="quick-search-inpage">
<label class="item item-stacked">
<select class="select" id="completed2" name="completed2" style="width: 160px"
ux-select data-ng-model="parentScope.userReportListFilter.completeStatus">
<option value="">Tamamlanma Durumu</option>
<option value="COMPLETED">Tamamlad─▒</option>
<option value="NOT_COMPLETED">Tamamlamad─▒</option>
<option value="CONTINUE">Devam Ediyor</option>

Since I am passing values from Java, there are no any variable or value about
in my JS code. (And as I said, it is working fine and filling up the dropdown list)

When I inspect element of that dropdown list, I'm seeing that it's state is not updating itself to ng-dirty.

I've checked some questions in SO, but couldn't find a similar one to my question.


Selecting value from dropdown list:

enter image description here

Selected value shown in the list:

enter image description here

Even though I've selected Tamamland─▒ from the list, I am still seeing Tamamlanma Durumu in the menu. So we can say that dropdown list is now showing the selected option.

Answer Source

For those who wants to know the answer, I was using "templates" to split up the HTML codes. When I moved my template the regular HTML code, it fixed the problem. I believe possible reason for problem is, like they stated in the comments, external library.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download