Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
simplealert
Advanced tools
A simple info/error/warn/success alert component for Angular using @angular/material
SimpleAlert is a simple Angular component for info, error, danger and success alerts, inspired by bootstrap alerts. It can be dynamically opened/closed with opening/closing animations and can contain any content via ng-content.
This Dependency is for use with Angular Material Design only. As of the first version, it requires Angular Material 6.0 or above (see version section for more information).
Start with a normal Angular App with Material Design installed.
Then install Simplealert using
npm install simplealert
Then import the SimplealertModule into your AppModule. The following snippet shows the minimum AppModule you need to use Simplealert:
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {AppComponent} from './app.component';
import {SimplealertModule} from '../../projects/simplealert/src/simplealert/simplealert.module';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
SimplealertModule,
BrowserAnimationsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {
}
To use Simplealert in your component, describe your info alert in the corresponding html file:
<smc-simplealert [(isOpen)]="isOpen" [type]="'info'">This is an info alert!</smc-simplealert>
You can either use the type AlertTypeString, which is one of the following strings: 'info'
, 'error'
, 'warn'
or 'danger'
or you can use the AlertType enum. If you use the enum, define the enum in your component like this:
alertType = AlertType;
so you can access it in your html.
You can either bind the is open input/output to a boolean variable in your component or only bind to the input variable isOpen of smc-simplealert and set it to true. If you chose to do the latter, the alert will be open initially. The user can click it away, but can't reopen it. If the user should be able to open the alert back up, you need to two way bind to isOpen and set it to true on user interaction, e.g. with the click on an info button.
The Sourcecode is in a public github repository. You may contribute by opening pull requests if you have any nice ideas for improvements, new features, bugfixes, unittests, ...
If there are any problems or if you have any questions, feel free to contact me. You can find my email address in the authors section. You can also open up an issue on github.
There will be new versions when new features are added or a new Angular version releases.
History (Version in parentheses is required Angular Version):
Simplealert only uses peer dependencies, so you need the following packages (with compatible versions) in your package.json:
"@angular/common": "^18.0.0",
"@angular/core": "^18.0.0",
"@angular/material": "^18.0.0",
"@angular/cdk": "^18.0.0",
"@angular/platform-browser": "^18.0.0",
Henning Wobken (henning.wobken@simplex24.de)
This project is licensed under the MIT License
FAQs
A simple info/error/warn/success alert component for Angular using @angular/material
We found that simplealert demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.