hjalmers / angular-generic-table

A generic table for Angular 2+. Generic table uses standard markup for tables ie. table, tr and td elements etc. and has support for expanding rows, global search, filters, sorting, pagination, export to CSV, column clicks, custom column rendering, custom export values.
https://hjalmers.github.io/angular-generic-table/
MIT License
105 stars 55 forks source link

generic table is not working inside of ng-template #268

Closed rcanpahali closed 5 years ago

rcanpahali commented 5 years ago

this is my code: ` <ng-template *ngIf="true">

        <div class="text-center">
            <gt-pagination [gtClasses]="'justify-content-center'" [genericTable]="table1"></gt-pagination>
        </div>
    </ng-template>`

When i remove ng-template, it's working... Is this bug ?

hjalmers commented 5 years ago

It might be, because it should work with ng-template so if it doesn’t we should fix it I think. I don’t have access to a computer at the moment and won’t have access to one for another week I’m afraid, but it might have something to do with the object references not being updated/set correctly when using ng-template. You could try skipping the gt object and just refer directly to settings, fields and data or declare them at the same time true becomes true not sure it works but I think I’ve come across this before at least.

rcanpahali commented 5 years ago

Thanks for your answer, It's not a problem for my situation. I used ngIf in my Div tag and fixed the issue. But i just wanted to tell if its really a bug or not. :)