angular.js 联动数据保存后编辑时怎样绑定数据?
ringa_lee
ringa_lee 2017-05-15 17:02:52
0
1
621

现在用angular做了一个省市区的三级联动,在增加数据时是没有问题的.但是当编辑页面时怎样把保存的那些地区数据,绑定到每个Select上去呢,因为这里的第二个,第三个数据是变化根据第一个项的选择项来变化的,初始化的时候是没有值的.
比如,我选择了<广东-东莞-万江>,怎样在编辑的时候,三个下拉的选中项是我前面的<广东-东莞-万江>,新手小菜一枚,请高手们提供下思路,不行的话,编辑的时候只有用完最原始的那种方法啦

ringa_lee
ringa_lee

ringa_lee

reply all(1)
曾经蜡笔没有小新

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!