![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
ngx-spinner
Advanced tools
Readme
A library with more than 50 different loading spinners for Angular 4 - 13. (https://napster2210.github.io/ngx-spinner/)
Use appropriate version based on your Angular version.
Angular 13 | Angular 12 | Angular 11 | Angular 10 |
---|---|---|---|
>=v13.1.1 | >=v12.0.0 | >=v11.0.2 | >=v10.0.1 |
Angular 9 | Angular 8 | Angular 6/7 | Angular 5 | Angular 4 |
---|---|---|---|---|
>=v9.0.1 | v8.1.0 | v7.2.0 | >=v1.2.0 | >=v2.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
Add css animation files to angular.json config
{
"styles": [
"node_modules/ngx-spinner/animations/ball-scale-multiple.css" // ===> Add css file based on your animation name(here it's "ball-scale-multiple")
// You're able to add multiple files if you need
]
}
Import NgxSpinnerModule
in in the root module(AppModule
):
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
// Import library module
import { NgxSpinnerModule } from "ngx-spinner";
@NgModule({
imports: [
// ...
BrowserAnimationsModule,
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 type="ball-scale-multiple"></ngx-spinner>
See Demo
NgxSpinnerService.show()
Shows the spinnerNgxSpinnerService.hide()
Hides the spinnerrgba(51,51,51,0.8)
where alpha
value(0.8) is opacity of backdropsmall
, default
, medium
, large
.
To set size of spinner, default large
#fff
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 Demoangular.json
filethis.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
.ball-8bits
animation(e.g. ball-8bits.css
)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.
Thanks ennjin for reducing the bundle size.
ngx-spinner is MIT licensed.
FAQs
A library with more than 50 different loading spinners for Angular 4 - 17. (https://napster2210.github.io/ngx-spinner/)
The npm package ngx-spinner receives a total of 113,213 weekly downloads. As such, ngx-spinner popularity was classified as popular.
We found that ngx-spinner demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.