August 2017
Beginner to intermediate
370 pages
8h 37m
English
As defined earlier, attribute directives change the appearance or behavior of an element, component, or another directive. The following is an example of a trivial attribute directive setting the custom style for the element:
<div myStyle>Hello World!</div>
The next code snippet is an example of the aforementioned attribute directive, myStyle. Pay attention to the following in the code:
import { Directive, ElementRef, Input } from '@angular/core';@Directive({ selector: '[myStyle]' }) export class ...
Read now
Unlock full access