Skip to main content

Creating Structural Directives

  • Chapter
  • First Online:
Pro Angular
  • 4568 Accesses

Abstract

Structural directives change the layout of the HTML document by adding and removing elements. They build on the core features available for attribute directives, described in Chapter 15, with additional support for micro-templates, which are small fragments of contents defined within the templates used by components. You can recognize when a structural directive is being used because its name will be prefixed with an asterisk, such as *ngIf and *ngFor. In this chapter, I explain how structural directives are defined and applied, how they work, and how they respond to changes in the data model. Table 16-1 puts structural directives in context.

An erratum to this chapter can be found at http://dx.doi.org/10.1007/978-1-4842-2307-9_30

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Adam Freeman

About this chapter

Cite this chapter

Freeman, A. (2017). Creating Structural Directives. In: Pro Angular. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-2307-9_16

Download citation

Publish with us

Policies and ethics