I have a Tiers drop down that provides options 1, 2 or 3. The corresponding ids are also 1, 2 and 3. These values are pulled from the Tiers table. When the user selects a value and saves, the corresponding Tier Id is saved in another table, InfoData. vm.infodata and vm.tiers are the controllers. In my html I have the following:
<select class="form-field" ng-model="vm.infodata.TiersID" name="Tiers" required ng-options="tier.Id as tier.Tier for tier in vm.tiers" ng-readonly= "vm.isreadonly" ng-disabled="vm.applyDisabled"> <option value="">Select Tier </option> </select> I confirmed that the id for the value that is selected is in fact being saved to the InfoData table. However, if I select "3", save close the browser and then reload sometimes the dropdown is empty. The following is what I recorded when selecting certain values and then reloading the page. And when I say reload I mean close the browser, open it up and then go to the page. : choose 3, reload, it's empty choose 1, reload, 2 displays choose 2, reload, 2 displays choose 3, reload, it's empty choose 2, reload, 3 displays leave 3, reload, 3 displays choose 3, reload, 3 displays choose 1, reload, 2 displays choose 1, reload, 2 displays I have two other dropdowns set up in a similar fashion which are populating the options from one table and saving the InfoTable. One is working exactly the same as the Tiers dropdown and the other is not. All three are set up the same way. The other one that is not working is as follows. This one also has ids 1 - 5 and corresponding values 0-4 <select class="form-field" ng-model="vm.infodata.StagedRatingsID" name ="StagedRating" ng-options="rating.Id as rating.RatingValue for rating in vm.stagedratings" ng-readonly="vm.isreadonly" ng-disabled ="vm.applyDisabled"> <option value="">Select Rating</option> </select> The one that is working is set up as follows. It also has ids but the corresponding values are High, Above Average, Moderate or Low <select class="form-field" ng-model="vm.infodata.CompositeRiskRatingsID" name="CompRiskRating" ng-options="riskrating.Id as riskrating.CompositeRiskRating for riskrating in vm.compriskratings" ng-readonly="vm.isreadonly" ng-disabled="vm.applyDisabled"> <option value="">Select Rating</option> </select> So the only differences, that I can see, between the three dropdowns is they are populating the dropdowns from different tables. The difference between the two that aren't working and the one that is, is the values displaying. What am I doing wrong? -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
