codejump

Component Basics

Preview — 3 of 10 questions

In Angular, what is the primary purpose of the @Component decorator?

AIt registers the class as an injectable service
BIt declares global styles for the entire application
CIt marks a class as an Angular component and provides metadata such as selector, template, and styles
DIt enables two-way data binding automatically

Which syntax is used to display a component property value in an Angular template?

A[property]
B(property)
C{{ property }}
D*property

What does [src]="imageUrl" do in an Angular template?

AIt sets the src attribute using string interpolation
BIt binds the DOM property src to the component's imageUrl property
CIt listens to the src event on the element
DIt applies a CSS class named imageUrl

Sign up free to play

Answer all 10 questions (7 more), see explanations for every answer, and track your score.