How to use ng-click in this way?

0

It's probably wrong to do it this way, but only then did I find datatable functionality.

<div class="panel-body">
    <script type="text/javascript">
        jQuery(document).ready(function($)
        {
            $("#example-1").DataTable({
                "ajax": {
                "url": "http://162.100.100.100/proyecto/public/ws/usuarios",
                "dataSrc": "records"
                },
                "columns": [
                    { "data": "id" },
                    { "data": "nombre1" },
                    { "data": "apellido1" },
                    { "data": "usuario" },
                    { "data": "idtipousuario" },
                    { "defaultContent": "<button class='btn btn-icon btn-info' ng-click='openModal(dataUsuario,'modal-2', 'lg');'><i class='fa-edit'></i></button>" }   
                ]
            });

             $('#example-1').on( 'click', 'button', function () {
                        //var data = table.row( $(this).parents('tr') ).data();
                       console.log("Mostrar Modal")
               });
        });
    </script>

For every record I filled in the table, I add a button

"defaultContent": "<button class='btn btn-icon btn-info' ng-click='openModal(dataUsuario,'modal-2', 'lg');'><i class='fa-edit'></i></button>"

How can I do with this button using ng-click to show a modal ?. Previously I filled the table with ng-repeat, but I lost the page, looking for the datatable.

How could I do this, or how else can I do it and if it is not possible, thank you very much. thank you very much.

    
asked by JG_GJ 10.03.2017 в 02:58
source

2 answers

1

An excellent way to implement what you need is using SmartTable

I hope you help my friend!

    
answered by 10.03.2017 / 14:12
source
0

I think using angular the way you're doing it is not going to work for you. It would be best if you changed the html code you are generating to use the onclick event instead of ng-click.

    
answered by 10.03.2017 в 13:30