Components Flashcards
Where do you define a component?
Inside a class ex:
export class HeroListComponent implements OnInit { }
hero-list.component.ts
What does the component do?
Controls a patch on the screen called view
What is two way data binding and how does it work?
A mechanism for coordinating the parts of a template with the parts of a component. It works by adding binding markup to the template HTML
https://angular.io/generated/images/guide/architecture/databinding.png
How do directives affect the page?
It transforms the DOM according to the instructions given by the directives. Directive is a class is @Directive decorator
What are the two types of directives?
Structural and Attribute
Why do we need structural directives?
Weed need them for manipulating the layout of the page by adding, removing and replacing elements in the DOM
Ex:
<li>
</li>
How does an attribute directive works?
They alter the appearance or behavior of an existing element. They look like HTML elements
ngModel directive