ng-table icon indicating copy to clipboard operation
ng-table copied to clipboard

one-time data binding on $data

Open buddhaCode opened this issue 8 years ago • 3 comments

Hi there, thanks for your great module. Is there any way to use one-time binding on the $data array in ng-repeat? Using this on the row works fine. But if add :: to $data no row will be rendered.

             <table ng-table="::listParams.articles" class="table table-striped">
                <tr ng-repeat="article in ::$data track by article.id">
                    <td data-title="'articleNumber'" sortable="'no'" ng-bind="::article.no"></td>
                    <td data-title="'articleDesc'" sortable="'name'" ng-bind="::article.name"></td>
                </tr>
            </table>

buddhaCode avatar Nov 04 '15 09:11 buddhaCode

Hello,

did you find a solution for this? From my point of view, the problem is that "data" is initialized as "[]" and therfor is stabilized when one-time binding takes place. I am new to AngularJS and cannot think about a good work around.

iZEY avatar Oct 22 '18 15:10 iZEY

Since, Angular 1 is a little out of date by now, I didn't investigate any further. Just used two-way binding.

buddhaCode avatar Oct 22 '18 15:10 buddhaCode

Touché! Sadly I came into a project that is still using Angular 1 :D But thanks for your quick response, have a good day.

iZEY avatar Oct 22 '18 15:10 iZEY