K
K
Konstantin2020-03-06 23:46:08
Angular
Konstantin, 2020-03-06 23:46:08

How to close a component?

There is a parent component inside which there are two others:

<app-parent>
    <app-child [type]="type == 'a'"></app-child>
    <app-child [type]="type == 'b'"></app-child>
</app-parent>


Inside the component <app-child [type]="type == 'a'"></app-child>there is a button component:

<app-child [type]="type == 'b'">
   <app-button [save]="callback($event)"></app-button>
</app-child>


How to hide a component <app-child [type]="type == 'b'">on the page when I receive a callback from a button inside the component itself?

How to properly organize such a data flow?

Does it make sense to forward the callback from the button above to and then even higher to which the type value controls?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question