Skip to content

PrimeNG v18 - Table Wrapper Component, how? #2797

Answered by qwadrox
denizguzel asked this question in PrimeNG
Discussion options

You must be logged in to vote

@denizguzel Hi.

Oh yes, I didn't consider the directives in my example.

I updated it for you to make it work: https://stackblitz.com/edit/yamuh2?file=src%2Fapp%2Ftree-table-basic-demo.ts

Using a factory function to provide the Table ensures that the data table property is correctly instantiated and available within the component's context. This resolves the NullInjectorError because the Table provider is explicitly defined and linked to the actual instance of the data table created in the component.

Things are getting complex, unfortunately. At this point, if I were you I would start to consider is this the right way to create reusable components. According to my experience, this might ad…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@denizguzel
Comment options

@qwadrox
Comment options

Answer selected by denizguzel
@denizguzel
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants