Loading Directive

You may want to block a part of the UI and show a spinner for a while; the LoadingDirective directive makes this for you. LoadingDirective has been exposed by the @abp/ng.theme.shared package.

Getting Started

In order to use the LoadingDirective in an HTML template, the ThemeSharedModule should be imported into your module like this:

// ...
import { ThemeSharedModule } from '@abp/ng.theme.shared';

@NgModule({
  //...
  imports: [..., ThemeSharedModule],
})
export class MyFeatureModule {}
JavaScript

Usage

The LoadingDirective is easy to use. The directive's selector is abpLoading. By adding the abpLoading attribute to an HTML element, you can activate the LoadingDirectiveective for the HTML element when the value is true.

See an example usage:

<div [abpLoading]="true">
    Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laboriosam commodi quae aspernatur,
    corporis velit et suscipit id consequuntur amet minima expedita cum reiciendis dolorum
    cupiditate? Voluptas eaque voluptatum odio deleniti quo vel illum nemo accusamus nulla ratione
    impedit dolorum expedita necessitatibus fugiat ullam beatae, optio eum cupiditate ducimus
    architecto.
  </div>
HTML

The abpLoading attribute has been added to the <div> element that contains very a long text inside to activate the LoadingDirective.

See the result:

Loading directive result

Contributors


Last updated: July 31, 2024 Edit this page on GitHub

Was this page helpful?

Please make a selection.

To help us improve, please share your reason for the negative feedback in the field below.

Please enter a note.

Thank you for your valuable feedback!

Please note that although we cannot respond to feedback, our team will use your comments to improve the experience.

Community Talks

Real World Problems and Solutions with AI

27 Feb, 17:00
Online
Watch the Event
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
×