Angular shift detection not working for notification component

Asked

Viewed 116 times

0

Hello.

I was implementing a notification component to present, on a screen, successful or error messages for user operations.

It is based on a Subject in a Service shared, where it feeds a list into an HTML that becomes a child of the header component. The problem is that when I publish a new alert, in this Subject, the screen does not update, because the change in the attribute is not being detected, I have tried approaches with the use of NgZone and ChangeDetectorRef, but none of them worked.

Could you help me?

All the code is in this repository.

  • It is difficult to understand the dislikes in the question, it is categorized correctly and I searched thoroughly before publishing only that cases similar to mine usually point solution with this Changedetectorref which did not work in my case, in addition the code for consultation and reproduction is all in the attached repository, if you do not have the answer simply ignore the question or point out the error and ask for the detailing, do not declassify for free as this decreases the visibility of the same, complicated dealing with the ill will of some

  • I don’t quite understand your question, but you want to use the same Component of messages in other Components? If so, I think this video can help you (or their sequence, up to 90) https://www.youtube.com/watch?v=5c7qo26j728&list=PLGxZ4Rq3BOBoSRcKWEdQACbUCNWLczg2G&index=82&t=0s

  • Please post the code referring to the question of external links

  • Right @Eduardovargas, I will pay attention to this, but I imagine that in the case of several related files becomes simpler and less verbose the question only relating the repository but I will follow its guidance

  • 1

    @Edwardramos is just another layout component like the header or footer but for the purpose of displaying alerts issued by certain actions in the system, the problem is that changes in attributes linked to this component are not reflected on screen because the detection is not notifying the template, but I will look at the series of videos yes to see if there is another approach, thank you

  • 1

    The ideal is that all the code needed to reproduce the problem is in the question itself, and links are only complements - please read the FAQ, which better explains all the reasons. If the original code is too large, try to reduce it to a [mcve].

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.