0
0
Angularframework~5 mins

Input signals and model signals in Angular - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is an input signal in Angular standalone components?
An input signal is a reactive value passed from a parent component to a child component, allowing the child to react to changes automatically.
Click to reveal answer
beginner
How do model signals differ from input signals in Angular?
Model signals are signals defined inside a component to hold and manage its own reactive state, while input signals come from outside the component.
Click to reveal answer
beginner
Which Angular function is used to create a model signal?
The `signal()` function is used to create a model signal inside a component to hold reactive data.
Click to reveal answer
intermediate
How do you declare an input signal in an Angular standalone component?
Use the `input()` function imported from `@angular/core`, for example: `count = input(0);` or `count = input.required<number>();` to receive a reactive input signal.
Click to reveal answer
intermediate
Why are signals preferred over traditional inputs for reactive data flow in Angular?
Signals provide automatic reactivity and better performance by tracking dependencies and updating only when needed, unlike traditional inputs which require manual change detection.
Click to reveal answer
What does an input signal in Angular represent?
AA lifecycle hook in Angular
BA method to fetch data from a server
CA CSS style applied to a component
DA reactive value passed from parent to child component
Which function creates a model signal inside an Angular component?
AcreateSignal()
Bsignal()
CuseState()
DsetSignal()
How do you mark a property as an input signal in Angular?
A@Output()
B@Model()
Cinput()
D@Signal()
What is a key benefit of using signals for inputs in Angular?
AThey automatically update when data changes
BThey disable change detection
CThey make components slower
DThey require manual event listeners
Where are model signals typically defined in Angular?
AInside the component to hold its own state
BIn the parent component only
CIn the Angular module file
DIn the CSS stylesheet
Explain how input signals and model signals work together in an Angular component.
Think about data flow from outside to inside the component.
You got /4 concepts.
    Describe the steps to create and use an input signal in an Angular standalone component.
    Focus on how data is passed and used reactively.
    You got /4 concepts.