A library with more than 50 different loading spinners for Angular 4 - 12. (https://napster2210.github.io/ngx-spinner/)
Use appropriate version based on your Angular version.
Angular 4 | Angular 5 | Angular 6/7 | Angular 8 | Angular 9 | Angular 10 | Angular 11 | Angular 12 |
---|---|---|---|---|---|---|---|
>= v1.2.0 |
>= v2.0.0 |
v7.2.0 |
v8.1.0 |
>=v9.0.1 |
>=v10.0.1 |
>=v11.0.2 |
>=v12.0.0 |
Chrome |
Firefox |
IE / Edge |
Safari |
Opera |
---|---|---|---|---|
Latest
|
Latest
|
IE11, Edge
|
Latest
|
Latest
|
img
tagshow()/hide()
methods return promisez-index
hide/show
the spinnerngx-spinner
is available via npm and yarn
Using npm:
$ npm install ngx-spinner --save
Using yarn:
$ yarn add ngx-spinner
Using angular-cli:
$ ng add ngx-spinner
Import NgxSpinnerModule
in in the root module(AppModule
):
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
// Import library module
import { NgxSpinnerModule } from "ngx-spinner";
@NgModule({
imports: [
// ...
NgxSpinnerModule
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
Add NgxSpinnerService
service wherever you want to use the ngx-spinner
.
import { NgxSpinnerService } from "ngx-spinner";
class AppComponent implements OnInit {
constructor(private spinner: NgxSpinnerService) {}
ngOnInit() {
/** spinner starts on init */
this.spinner.show();
setTimeout(() => {
/** spinner ends after 5 seconds */
this.spinner.hide();
}, 5000);
}
}
Now use in your template
<ngx-spinner></ngx-spinner>
See Demo
NgxSpinnerService.show()
Shows the spinnerNgxSpinnerService.hide()
Hides the spinnerrgba(51,51,51,0.8)
where aplha
value(0.8) is opacity of backdropsmall
, default
, medium
, large
.To set size of spinner, default large
#fff
ball-scale-multiple
true
or false
To enable/disable fullscreen mode(overlay), default true
primary
99999
null
true
or false
To show/hide spinner from template using variabletrue
or false
To enable/disable fade animation of spinner, default false
<ngx-spinner
bdColor="rgba(51,51,51,0.8)"
size="medium"
color="#fff"
type="ball-scale-multiple"
>
<p style="font-size: 20px; color: white">Loading...</p>
</ngx-spinner>
<ngx-spinner
bdColor="rgba(0, 0, 0, 1)"
template="<img src='https://media.giphy.com/media/o8igknyuKs6aY/giphy.gif' />"
>
</ngx-spinner>
HTML
code as loading text now, instead of input parameter(loadingText
). Check above code for reference.ngx-spinner
instance, just add name
attribute with ngx-spinner
component. But in this case, you've to pass that particular name of a spinner in show/hide
method. Check Demothis.spinner.show("mySpinner", {
type: "line-scale-party",
size: "large",
bdColor: "rgba(0, 0, 0, 1)",
color: "white",
template: "<img src='https://media.giphy.com/media/o8igknyuKs6aY/giphy.gif' />"
});
type
will be ball-8bits
.CUSTOM_ELEMENTS_SCHEMA
as your schema in your main module.show()
methods in a single component or single function one after another then wrap the show()
method within setTimeout()
method to avoid any rendering issue.fullScreen: false
), in that case your parent element of spinner must have position: relative;
style property.ngx-spinner will be maintained under the Semantic Versioning guidelines.Releases will be numbered with the following format:
<major>.<minor>.<patch>
For more information on SemVer, please visit http://semver.org.
Inspired by Load Awesome by Daniel Cardoso.
Thanks Alex Vieira Alencar for helping me with Multiple Spinner Support.
ngx-spinner is MIT licensed.
1.引入 在module文件中引入 import {NgxSpinnerModule} from 'ngx-spinner'; 2.imports写入 @NgModule({ imports: [ NgxSpinnerModule, ], }) 3.html文件 <ngx-spinner type="ball-scale-multiple"> <p class="tex
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android
ngx-weui 是一个使用 Angular 构建的 WeUI 组件。 在线示例以及API文档。
ngx-fastdfs 是 nginx + lua +fastdfs 实现分布式图片实时动态压缩。 install 进入docker目录docker build -t fastdfs:dev . 使用 docker -idt -p 80:80 fastdfs:dev /bin/bash进入容器执行/etc/rc.local 测试 进入容器执行test目录下的./test.sh或者直接执行下面脚本
ngx-markdown ngx-markdown is an Angular library that combines... Marked to parse markdown to HTML Prism.js for language syntax highlight Emoji-Toolkit for emoji support KaTeX for math expression rende
ngx-admin Who uses ngx-admin?| Documentation | Installation Guidelines | Angular templates New! Material theme for ngx-admin Material admin theme is based on the most popular Angular dashboard templat
@sweetalert2/ngx-sweetalert2 Official SweetAlert2 integration for Angular This is not a regular API wrapper for SweetAlert (which already works very well alone), it intends to provide Angular-esque ut
ngx-dropzone A lightweight and highly customizable Angular dropzone component for file uploads. For a demo see DEMO. And the CODE for the demo. Install $ npm install --save ngx-dropzone Usage // in ap
ngx-slick Support angular 6+, Slick 1.8.1 Example Installation To install this library, run: $ npm install ngx-slick --save Consuming your library Once you have published your library to npm, you can
Angular Module for displaying a feed of items in a masonry layout using https://github.com/desandro/masonry This package was originally a fork from https://github.com/jelgblad/angular2-masonry to allo