liveBook · Manning

Selector property

A selector property is component or directive metadata specifying the element, attribute, or pattern that identifies where it applies in a template.

How 2 Manning books explain it

Pro Angular 16

An Angular directive selector is metadata that specifies which elements or attributes cause a directive to be applied.

How it is used
Identifies the host elements on which Angular applies components or directives.
How deep it goes
Explains selector-to-host matching through component setup and a directive change, without detailing selector parsing.
Examples
Shows `app-root` and `app` hosts, nested form and table components, and a `td[paApplyColor]` directive selector.
What you can do after
Operate/configure it by matching a selector to an HTML host or changing a selector to prevent a directive from applying.

Read how Pro Angular 16 explains selector property →

Essential TypeScript 5, Third Edition

A selector property is Angular component metadata that specifies the element or attribute pattern identifying where the component is used in a template.

How it is used
Identifies component locations in HTML and enables Angular to compose nested application views.
How deep it goes
Defines CSS-selector matching and follows resolution through nested templates, but stops short of selector syntax variations.
Examples
Uses product-item, product-list, header, and category-list elements in product-list.component.html and app.component.html.
What you can do after
Apply it via Angular by assigning a selector and placing the matching element in a declared component template.

Read how Essential TypeScript 5, Third Edition explains selector property →

What to know first

Related concepts

Questions about selector property

What is selector property?

A selector property is component or directive metadata specifying the element, attribute, or pattern that identifies where it applies in a template.

Which Manning books explain selector property?

Pro Angular 16 and Essential TypeScript 5, Third Edition.

What should I know before learning selector property?

Manning books that teach selector property usually introduce HTML element first.

What is selector property part of?

Selector property is part of component decorator. A component decorator or annotation attaches metadata to a class to identify or configure it as a component managed by a software framework.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.