NgxAlert
npm install pf-ngx-alert
app.module.ts
...something...
import { NgxAlertModule } from 'pf-ngx-alert';
@NgModule({
...something...
imports: [...something..., NgxAlertModule],
...something...
})
export class AppModule {}
app.component.html
<ngx-alert></ngx-alert>
ng g c Test
test.component.html
<button (click)="alert()">ALERT</button>
test.component.ts
import { ngxAlert } from 'pf-ngx-alert';
export class TestComponent implements OnInit {
constructor() { }
ngOnInit() { }
alert() {
ngxAlert(
'Title', /* Title */
'Message', /* Message */
'success' /* Type */
).then(result => {
/* Do something... */
});
}
}
Argument | Required | Default value | Type | Description |
---|---|---|---|---|
ngxTitle |
yes | none | string | 標題 |
ngxMessage |
yes | none | string | 內容 |
ngxType |
yes (success 、error 、confirm ) |
none | string | 類型 |
Argument | Required | Default value | Type | Description |
---|---|---|---|---|
backgroundColor |
no | #fffdeb |
string | 背景色 |
submitBtnColor |
no | #005dbd |
string | 確認按鈕顏色 |
closeBtnColor |
no | #ffffff |
string | 取消按鈕顏色 |