34 lines
698 B
TypeScript
34 lines
698 B
TypeScript
import { Injectable, inject } from '@angular/core';
|
|
import { NzMessageService } from 'ng-zorro-antd/message';
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class NotificationService {
|
|
private message = inject(NzMessageService);
|
|
|
|
success(content: string): void {
|
|
this.message.success(content);
|
|
}
|
|
|
|
error(content: string): void {
|
|
this.message.error(content);
|
|
}
|
|
|
|
warning(content: string): void {
|
|
this.message.warning(content);
|
|
}
|
|
|
|
info(content: string): void {
|
|
this.message.info(content);
|
|
}
|
|
|
|
loading(content: string): string {
|
|
return this.message.loading(content, { nzDuration: 0 }).messageId;
|
|
}
|
|
|
|
remove(id: string): void {
|
|
this.message.remove(id);
|
|
}
|
|
}
|