I
I
Ivan Stroykin2017-02-03 11:12:41
Angular
Ivan Stroykin, 2017-02-03 11:12:41

Angular2: Where is the best place to put a popup message?

Good day,
There is a jQuery notification popup that can be called, for example, on a successful or unsuccessful request to the backend.
This economy is called like this (there are different ones):

$.smallBox({
    title: "Какая-то ошибка",
    content: "<i class='fa fa-clock-o'></i> <i>Какая-то информация об ошибке...</i>",
    color: "#C46A69",
    iconSmall: "fa fa-check fa-2x fadeInRight animated",
    timeout: 4000
});

I want to take it out so as not to produce the same code. But I think, where is it better? Like a directive? But we will not refer to it from the template.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SirMustache, 2017-02-03
@StivinKing

Separate Notification component and service.
Example: https://github.com/flauc/angular2-notifications

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question