Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 20, 2022 07:50 am GMT

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- import alertifyjs to componentName.component.ts file you want to use:

import * as alertifyjs from 'alertifyjs';

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

and add in the file:

declare module 'alertifyjs';

5- Add to tsconfig.json file:

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

Image description

6- use in component:

successfully:
alertifyjs.successfully('message');

or error:
alertifyjs.error('message')

source code


Original Link: https://dev.to/gulsenkeskin/angular-alertifyjs-configuration-e2

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To