Closed VincenzoManto closed 3 months ago
@VincenzoManto were you able to resolve this? I am facing the similar issue.
@dpw-dev yes, we opted for using this.block.start('content-wrapper');
and this.block.stop('content-wrapper');
, directly controlling the spinner in the TS and ensuring to do it after the view content is initialized (so after the AfterViewInit event)
Hey @VincenzoManto thank you for the suggestion. However, when I tried implementing it, I am still facing the issue. Is the below div on the app level or in the component inside the library?.
<div *blockUI="'content-wrapper'" class="content-wrapper"></div>
If possible could you share a sample project structure?
Appreciate the help.
Thanks
<div *blockUI="'content-wrapper'" class="content-wrapper"></div>
is at the HTML component level in the library. We suggest to remove this directive and directly use the this.block.start('content-wrapper');
and this.block.start('content-wrapper');
in the component TS to control the block tag wherever you need in the logic class
Thanks @VincenzoManto. That works.
Issue with ng-block-ui in Angular 16
Description
Using
ng-block-ui@4.0.1
in Angular 16 works as expected when included within an application project, but it fails in libraries.We include
ng-block-ui
as follows:The spinner displays properly when used within an application, but when the library is compiled in ES2022 and included in an application, it always appears as
undefined
, regardless of where or when it is checked (inngOnInit
,ngAfterViewInit
,constructor
, and even in asynchronoussubscribe
), long after the template rendering.Environment
Angular CLI: 16.2.5
Node: 19.6.0 (Unsupported)
Package Manager: npm 9.5.0
Operating System: Win32 x64
Angular: 16.2.8
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Versions
Steps to Reproduce
ng-block-ui
in an Angular library project.@BlockUI
decorator and*blockUI
directive within library components.undefined
.Expected Behavior
The
ng-block-ui
spinner should function correctly in both library and application projects when using the same code.Additional Information
ng-block-ui
.ng-block-ui
within the library.Please let me know if you need any additional information to help resolve this issue.