Skip to main content

How do Angular directives communicate?

Mid Angular
Quick Answer Directives communicate through: parent-child via DI (inject parent directive in child constructor - same element or ancestor), shared service (both directives inject the same service), host binding/listener (directive reads/modifies host element), or through the component's @Input/@Output if the directive is on a component. Siblings on the same element can reference each other via DI.

Answer

Communication via selectors, dependency injection, or parent-child directive references.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice