Angular 2 Loading Buttons with example

Angular 2 Loading Buttons with example

In this post we will show you Angular 2 Loading Buttons with example, hear for Angular 2 Loading Buttons with example we will give you demo and example for implement.

Angular 2 Loading Buttons is a vary simple module that lets you add a loading indicator to a button of your choice Buttons .  

Hear is Git hub like for Download, Demo and for information(Read More), it will help you into development and implement for Angular 2 Loading Buttons with example. This link of git will give you document, instruction, installation and other information.

Read More Demo Download

Beginning for Angular 2 Loading Buttons

Introduce it through npm for Angular 2 Loading Buttons:

// Install it via npm
npm install angular2-promise-buttons -S

Also, add it as a reliance to your principle module

import {Angular2PromiseButtonModule} from 'angular2-guarantee catches/dist';


imports: [




send out class MainAppModule {


Utilizing the catches is simple. Simply pass a guarantee to the mandate:

<button (click)="someAction()"

[promiseBtn]="promiseSetBySomeAction">Click me to spin!</button>

send out class SomeComponent {

/some case async activity, yet this works with any guarantee


this.promiseSetBySomeAction = new Promise((resolve, dismiss) => {

setTimeout(resolve, 2000);




Styling the catch for Angular 2 Loading Buttons

To give you greatest adaptability there are no base styles accompanying the mandate, yet it is anything but difficult to fix that! There are bunches of free css-spinners out there. Simply discover one of your loving and add the css to your worldwide template.

There are selectors you can use to style. There is the .is-stacking class on the catch, which is set, when the guarantee is pending and there is the component inside the catch.

Design for Angular 2 Loading Buttons

Design is done by means of the forRoot strategy for the guarantee catch module:

// angular2 guarantee
import {Angular2PromiseButtonModule} from 'angular2-guarantee catches';
// imports
imports: [
//your custom config goes here
spinnerTpl: '<span class="btn-spinner"></span>',
//handicap catches when guarantee is pending
disableBtn: genuine,
//the class used to demonstrate a pending guarantee
btnLoadingClass: 'is-stacking',
//just handicap and show is-stacking class for clicked catch,
//notwithstanding when they share a similar guarantee
handleCurrentBtnOnly: false,
send out class MainAppModule {


See this Url :: :: :: :: ::

Hope this code and post will helped you for implement Angular 2 Loading Buttons with example. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve onlincode. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

Leave a Comment

Your email address will not be published. Required fields are marked *

27  +    =  29

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US