@ng-mg/loading-if
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

#@ng-mg/loading-if

Structural directive used similar as *ngIf but automatically will add an Spinner component to the DOM while loading. Once the loading is done, the DOM will be replaced with the actual container where the directive is placed

Examples usage

    <div *ngMgLoadingIf="data"> ... </div>
    <div *ngMgLoadingIf="data$ | async"> ... </div>
    <div *ngMgLoadingIf="data$ | async; let myData"> ... </div>

Additional configurations

You can use some extra parameters inline the structural directive:

Parameter Type Value
containerClass string / string[] CSS Classes to be attached to the Spinner Component container
error boolean It could stop loading and show the Error Component
errorMessage string The message shown on the Error Component

Next steps

Let the developer inject their own Spinner Component and Error Component

Readme

Keywords

none

Package Sidebar

Install

npm i @ng-mg/loading-if

Weekly Downloads

0

Version

0.0.3

License

none

Unpacked Size

169 kB

Total Files

29

Last publish

Collaborators

  • bebeto84