BessemFer / jquery.bootgrid-with-AngularJs

How to use jquery.bootgrid with angularJs (ng-repeat)
1 stars 0 forks source link

Problem with formatters and binding ng attributes #1

Open fdorantesm opened 7 years ago

fdorantesm commented 7 years ago

Hi, thanks for this module.

I had a problem when im trying to add new html with ng attributes.

app.directive('ngBootgrid',["$timeout",function(timeout){
            return {
                link: function(scope, element, attr){
                    scope.$watch(attr.bootgrid,function(newVal, oldVal){
                        if(newVal != oldVal && newVal){
                            timeout(function(){
                                element.bootgrid({
                                    formatters:{
                                        commands:function(column,row){
                                            return '<button class="btn btn-danger" ng-click="delete('+row["id"]+')"><span class="md md-delete"></span></button>'
                                        }
                                    }
                                })
                            })
                        }
                    }   
                );
            }
        }
<tr ng-repeat="user in users">
                        <td><%user.id%></td>
                        <td><%user.name%></td>
                        <td><img ng-src="{{URL::to('./static/usrcnt/avatars/')}}/<%user.avatar%>"></td>
                        <td><%aviso.created_at%></td>
                        <!-- <td><a ng-click="remove(user.id)" class="btn btn-danger"><span class="md md-delete"></span></a></td> -->
                        <td></td>
                    </tr>

What im doing wrong?

Regards

caox2110 commented 7 years ago

I have the same exactly error. This could finally be fixed?