Cell button in datatables using AngularJS

試著忘記壹切 提交于 2019-12-02 21:03:41

Yes, you're right, ng-click directive wasn't compiled by angular. So the most straight forward way is to use onclick listener:

 "<button onclick=\"angular.element(this).scope().botaoEdit('"+dbStuff[key].name+"')\">test button</button>"

Don't forget to add quotes: botaoEdit(''), in your fiddle you try to access Stuff1 variable :)

In the end, I think the best way is to use some grid plugin or ng-repeat, that would build rows for your table when data recieved. In this approach ng-click in your rows will work fine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!