Description
In this chapter let us study about Angular 2 directive. Templates of the Angular are dynamic, when these templates are rendered by Angular, it changes the DOM according to the directive fed instructions. The directive is a class which contains metadata which will be attached to the class by theThe directive is a class which contains metadata which will be attached to the class by the @Directive decorator.
Angular has three kinds of directives and is briefly explained in below table:
S.N. | Directives & Description |
---|---|
1 | Component It is a directive-with-a-template and the @Component decorator which is indeed a @Directive decorator wherein the template-oriented features is extended. |
2 | Structural directives It alters the layout of the DOM by adding, replacing and removing its elements. |
3 | Attribute directives It changes the appearance or behavior of a DOM element. These directives look like regular HTML attributes in templates. |
No comments:
Post a Comment