Skip to content
Snippets Groups Projects
Commit 64a859a4 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #5829 add notification service for actions

parent 20394790
No related branches found
No related tags found
No related merge requests found
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
var md2_1 = require("md2");
var core_1 = require("@angular/core");
var NotificationService = (function () {
function NotificationService(toast) {
this.toast = toast;
}
NotificationService.prototype.success = function (message) {
this.toast.show('<i class="fa fa-info-circle fa-2x"></i><span>' + message + '</span>', 2000);
};
NotificationService.prototype.error = function (message) {
this.toast.show('<i class="fa fa-exclamation-triangle fa-2x"></i><span>' + message + '</span>', 2000);
};
return NotificationService;
}());
NotificationService = __decorate([
core_1.Injectable(),
__metadata("design:paramtypes", [md2_1.Md2Toast])
], NotificationService);
exports.NotificationService = NotificationService;
import {Md2Toast} from 'md2';
import {Injectable} from '@angular/core';
@Injectable()
export class NotificationService {
constructor(private toast: Md2Toast) {
}
success(message:string) {
this.toast.show('<i class="fa fa-info-circle fa-2x"></i><span>'+message+'</span>', 2000);
}
error(message:string) {
this.toast.show('<i class="fa fa-exclamation-triangle fa-2x"></i><span>'+message+'</span>', 2000);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment