Angular · Middle · Question 12 of 75

What is an input transform used for?

disabled = input(false, { transform: booleanAttribute });
// usage: <app-button disabled />

Explanation

Without the transform, <app-button disabled /> would pass an empty string. Angular ships booleanAttribute and numberAttribute; transforms must be pure functions.

Further reading

Problem with a question

Angular · Middle · question 12

Test yourself

Take the Angular · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz