EasyRecon/Hunt3r

View on GitHub
frontend/src/app/shared/message.service.ts

Summary

Maintainability
A
0 mins
Test Coverage
import {Injectable } from '@angular/core';
import {
  NbToastrService,
  NbComponentStatus

} from '@nebular/theme';







@Injectable({
  providedIn: 'root'
})

export class MessageService {
    constructor(private toastrService:NbToastrService) { }
    showToast(message: string, status: NbComponentStatus = 'danger') {
        if(status == 'danger' ) this.toastrService.show(message, 'Error', { status });
        if(status == 'success' ) this.toastrService.show(message, 'Success', { status });
      }

 }