DEV Community

Gülsen Keskin
Gülsen Keskin

Posted on

Angular Alertifyjs Configuration

1- install alertifyjs:

npm install alertifyjs --save

2- Add to style.css:

@import "../node_modules/alertifyjs/build/css/alertify.css";
@import "../node_modules/alertifyjs/build/css/themes/bootstrap.min.css";
@import "../node_modules/alertifyjs//build/css/themes/default.min.css";

3- Create alertifytype.d.ts file in src directory

and add in the file:

declare module 'alertifyjs';

4- Add to tsconfig.json file:

"typeRoots": ["node_modules/@types","src/alertifytype.d.ts"],

Image description

5- import alertifyjs to componentName.component.ts file you want to use:

import * as alertifyjs from 'alertifyjs';

6- show alertify message:

success:
alertifyjs.success('message');

or error:
alertifyjs.error('message')

Top comments (0)