
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@csiro-geoanalytics/ngx-cool-dialogs
Advanced tools
Astounding alert, confirm and prompt dialogs for Angular.
Easily create astounding alert, confirm and prompt dialogs for Angular. Think of window.alert
or window.confirm
, but more angularish and way cooler.
Demo: https://ngx-cool-dialogs.carlosroso.com/
The project is forked from the original https://github.com/caroso1222/ngx-cool-dialogs and republished as
@csiro-geoanalytics/ngx-cool-dialogs
as original project is no longer compatible with Angular 16+ and author seemed to become inactive.
This new version is upgraded to Angular 16 CLI/core/material.
npm i @csiro-geoanalytics/ngx-cool-dialogs
NgxCoolDialogsModule
to your core module (e.g. app.module.ts
). You can optionally
pass a config object as the parameter of the forRoot
method.import { NgxCoolDialogsModule } from "@csiro-geoanalytics/ngx-cool-dialogs";
@NgModule({
...,
imports: [
...,
NgxCoolDialogsModule.forRoot(globalConfig)
],
...
})
export class MyCoreModule { }
NgxCoolDialogsService
as a dependency of your component.constructor(private coolDialogs: NgxCoolDialogsService) {}
BrowserAnimationsModule
imported in your root module (e.g. app.module.ts
).import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
...
@NgModule({
declarations: [ ... ],
imports: [
...,
BrowserAnimationsModule,
...
],
providers: [ ... ],
bootstrap: [ AppComponent ]
})
alert
, confirm
, prompt
.// Alert
this.coolDialogs.alert("Whoa boy, be careful!");
// Confirm
this.coolDialogs.confirm("Do you blindly accept our conditions?")
.subscribe(res => {
if (res)
console.log("You clicked OK. You dumb.");
else
console.log("You clicked Cancel. You smart.");
});
// Prompt. Callback param has the following form:
// { result: boolean, value: string }
this.coolDialogs.prompt("Please type your email below.")
.subscribe(res => {
if (res.result)
console.log("Thanks, now we have your email:", res.value);
});
You can globally configure all your dialogs for properties like titles, texts and colors. Do this
by passing a config object in the forRoot
module declaration (see step 1).
NgxCoolDialogsModule.forRoot(globalConfig: NgxCoolDialogsGlobalConfig)
NgxCoolDialogsGlobalConfig
Find below an example of a global config object. Please note that all these properties are optional. Please check out the SOURCE for full descriptions of all properties and its allowed and default values.
NgxCoolDialogsModule.forRoot({
theme: "material", // available themes: "default" | "material" | "dark"
okButtonText: "Yes",
cancelButtonText: "No",
color: "#8030c3",
titles: {
alert: "Danger!",
confirm: "Confirmation",
prompt: "Website asks..."
}
});
You can also pass a configuration object to the methods alert()
, confirm()
and prompt()
as the
second argument. Any property set here will obviously override the corresponding global configuration.
NgxCoolDialogsLocalConfig
The configuration example below applies for any of the three main methods. Please check out the SOURCE for full descriptions of all properties and its allowed and default values.
this.coolDialogs.confirm("Do you agree to follow Barça?", {
theme: "dark",
okButtonText: "Yes, I do",
cancelButtonText: "Nope",
color: "red",
title: "Wait, think twice"
});
Note: When using prompt
, you can also set the defaultText
property which will be used to
autofill the text input.
Feel free to open issues, shoot PRs, etc.
This is really just a good ol" Angular CLI project. Feel free to clone the project and play around if you
feel like adding new features or fixing bugs. All the library code lies inside ./projects/ng-lib/src/
.
The project uses ng-packagr
for Angular library packaging.
MIT
FAQs
Astounding alert, confirm and prompt dialogs for Angular.
We found that @csiro-geoanalytics/ngx-cool-dialogs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers 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.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.