In fact, this is my problem. The solution to the problem is to directly bind the ng-model to the object, and then bind the value of the option to the same object. This solves the 'selection problem'. In the background, the id or text value is taken directly from the object. id or text. thanks!
It is available in the official documentation of angularJS. You need to bring your own ladder The following is an example from the documentation of the version 1.4.7 I used
The result is that the name part is displayed in the option, and the model obtains the id. The model here uses data.repeatSelect because the loop is on the option, resulting in a different scope
Just use ng-options
The code is a bit slow to load. . Wait a moment to see the effect:
http://codepen.io/flybywind/pen/GZyydY
template
script
In fact, this is my problem. The solution to the problem is to directly bind the ng-model to the object, and then bind the value of the option to the same object. This solves the 'selection problem'. In the background, the id or text value is taken directly from the object. id or text. thanks!
It is available in the official documentation of angularJS. You need to bring your own ladder
The following is an example from the documentation of the version 1.4.7 I used
The result is that the name part is displayed in the option, and the model obtains the id. The model here uses data.repeatSelect because the loop is on the option, resulting in a different scope