How to reload child components based on some events from the parent (RC4)

I have some child components listed as directives in the parent component, I wanted to reload all child components based on some events caused by one of the child components.

Please refer to the plunker http://plnkr.co/edit/x19FmBkf0mP1A6xvre8B?p=preview See a snapshot of my requirement. enter image description here In plunker, you may notice that the layout component has application list components and ReportGroupList in directives. my requirement is that when the application list component emits an event based on user interaction, the ReportGroupList component (related to the application list component) must be reloaded. This ReportGroupList component is loaded based on the selected ApplicationList drop-down list. Therefore, every time the drop-down parameter of the application list changes, other components within the layout are reloaded.

@Component({
  selector:'layout',
  inputs:['loggedInUser'],
    template: `
<Application-List ></Application-List>

    ReportGroupList:
    <ReportGroupList></ReportGroupList>
    `,
    directives:[ReportGroupList, ApplicationList, ROUTER_DIRECTIVES]
})

What is the way to do this?

+4

Source: https://habr.com/ru/post/1652892/


All Articles