Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 841 Bytes

README.md

File metadata and controls

9 lines (6 loc) · 841 Bytes

Directives

Directives are entities that change the behavior of components or elements and are one of the core building blocks Angular 2 uses to build applications. In fact, Angular 2 components are in large part directives with templates.

From an Angular 1 perspective, Angular 2 components have assumed a lot of the roles directives used to. The majority of issues that involve templates and dependency injection rules will be done through components, and issues that involve modifying generic behaviour is done through directives.

There are two main types of directives in Angular 2:

  • Attribute directives - directives that change the behavior of a component or element but don't affect the template
  • Structural directives - directives that change the behavior of a component or element by affecting how the template is rendered