jtp-alert
v0.3.6
Published
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.7.3.
Downloads
10
Maintainers
Readme
JtpAlert
This project was generated with Angular CLI version 1.7.3.
Install
To install this, use:
npm install --save jtp-alert
Use
To use in your project import it in your module like that:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AlertModule } from 'jtp-alert';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AlertModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
and use in your component:
<div style="text-align:center" (click)="show(alert)"></div>
<jtp-alert #alert [data]="data"></jtp-alert>
and
export class AppComponent {
data = {
title: 'Test title',
message: 'Message for user',
type: 'success',
btns: [
{
name: 'OK',
function: () => {
console.log('Ok button works');
},
order: 1,
close: true,
main: true
},
{
name: 'Cancel',
close: false
}
]
};
show(alert){
alert.show();
}
}
And done!
Example
You can see the example of the usage in the example project.
Special thanks
Thanks for hendrathings that helped me on StackOverFlow and solve the problem ionicons's fonts not loading.