Angular 2 @ViewChild vs. ActionsUp / DataDown

Question: When to use @ViewChild for nested components? And when to use the @ Output / @ Input (ActionsUp / DataDown) paradigm?

In Angular2, you can use the @ViewChild decorator to capture a nested component and call nested component methods in the parent component. But this is a bit like a component tree paradigm, following @ Output / @ Input-paradigm! I thought components should be free using @Input for property bindings and @Output for EventEmmiting !?

+4
source share

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


All Articles