javascript - Please tell me how to get the data of the current row in the table in angular1.x (that is, how to get the DOM in angular)
阿神
阿神 2017-05-15 17:14:16
0
1
620

As shown in the figure, there is such a table. The data in the table are requested from the server and written into the table using ng-reapeat {{}}. Now I want to realize that when the 退房 button is clicked, 当前行’s dataalert comes out. (That is, there are many rows of such data in the table, and you can get the data in the corresponding row by clicking the 退房 button in different rows).

If you use jquery to get DOM and print it out text.
But there is no way to start using angular thinking.
I just learned to use angular as a newbie. I hope you can provide some ideas or implementation methods. Thank you very much!

阿神
阿神

闭关修行中......

reply all(1)
巴扎黑

ng-click事件添加scope内function。ng-repeatWith $index parameter, pass $index into the trigger function of ng-click event, and you can alert if you find the corresponding data in the controller.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template