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!
ng-click
事件添加scope内function。ng-repeat
With $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.