exportAs in Angular: What It Does and When to Use It
May 22, 2025Directives with public methods or signals need a way to expose their API to parent components, but accessing directive instances from templates requires explicit references. Angular's exportAs property lets you create template references to directives, enabling access to their methods, signals, and properties directly in templates. This tutorial demonstrates how to use exportAs to create reusable directives with clean, declarative APIs, following patterns used by Angular Material components.