search

Home  >  Q&A  >  body text

How to bind data when editing after saving linked data in angular.js?

Now I have used Angular to create a three-level linkage between provinces and cities. There is no problem when adding data. But when editing the page, how to bind the saved regional data to each Select, because here The second and third data change according to the selection of the first item. During initialization, It has no value.
For example, if I choose <Guangdong-Dongguan-Wanjiang>, how come when editing, the three drop-down selected items are the <Guangdong-Dongguan-Wanjiang> in front of me. It’s just a piece of cake for newbies, please give some ideas from the experts. If it doesn’t work, you can only use the most original method when editing

ringa_leeringa_lee2800 days ago727

reply all(1)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-15 17:04:52

    I don’t quite understand what effect you want. Here is a selection method. Take a look. Angular is a two-way binding. If you directly update the array of the drop-down list, the drop-down list will be displayed. As for displaying the selected item, it seems that a default value is enough. Give it a try. I forgot about it after a long time.

    reply
    0
  • Cancelreply