Skip to content
KnowledgeCity

Communicating between Angular Components

This chapter will demonstrate different ways you can send information between components, depending on their relationship to each other. You’ll learn how to pass information from parent to child, child to parent, or both ways between two components.
Preview the first lesson free — get full access to all 7 lessons.
Course: On-Demand
Intermediate Provider Michaela Ochnich  7 Lessons ·  36m  in Arabic, German, English, Spanish, French, Portuguese, Chinese 

Course Description

This chapter will demonstrate different ways you can send information between components, depending on their relationship to each other. You’ll learn how to pass information from parent to child, child to parent, or both ways between two components. You’ll also learn how to intercept some of these data changes, and alter them if needed before use in the component.

What You'll Learn

  • Send data from a parent component to a child component using Input, Setters and Getters, and OnChanges
  • Send data from a child component to a parent component using Output and EventEmitter
  • Access a child component through the parent's template or class using ViewChild and Reference Variables
  • Communicate bidirectionally between two components
  • Intercept data changes and alter them before they are used in the component
  • Share data between components using a Shared Service

Key Takeaways

  • The way you communicate between Angular components depends on their relationship to each other.
  • Information can be passed from parent to child, from child to parent, or both ways between two components.
  • Some data changes can be intercepted and altered before they are used in the component.
  • A parent can access a child component through the parent's template or class.
  • A shared service is one approach to communicating between components.

Frequently Asked Questions

What does this course cover?

This chapter demonstrates different ways to send information between Angular components depending on their relationship, including passing data from parent to child, child to parent, or bidirectionally between two components, and intercepting data changes to alter them before use.

What will I learn to do in this course?

You will learn how to send data from a child component to a parent component, send data from a parent component to a child component, access a child component through the parent's template or class, and communicate bidirectionally between two components.

What topics or techniques are taught in the lessons?

The lessons cover Input, Setters and Getters, OnChanges, Output and EventEmitter, ViewChild, Shared Service, and Reference Variables.

What skills does this course help me build?

It builds skills in Angular Components, Communication Diagrams, Component Diagram, Component Libraries, Connected Components, and HTML Components.

Can I learn to modify data before a component uses it?

Yes. The course teaches how to intercept some of these data changes and alter them if needed before use in the component.