Bird
0
0

Consider this Angular template:

medium📝 Predict Output Q5 of 15
Angular - Template-Driven Forms
Consider this Angular template:
<input name="age" ngModel required min="18" max="65">

What will happen if the user enters '70'?
AThe input is invalid because it is less than min value.
BThe input is valid because it is a number.
CThe input is invalid because it exceeds the max value of 65.
DThe input is accepted and form submits.
Step-by-Step Solution
Solution:
  1. Step 1: Understand min and max attributes

    The min and max attributes set numeric limits. Input must be between 18 and 65 inclusive.
  2. Step 2: Check input value against limits

    Value '70' is greater than max 65, so input is invalid.
  3. Final Answer:

    The input is invalid because it exceeds the max value of 65. -> Option C
  4. Quick Check:

    min/max attributes enforce numeric range [OK]
Quick Trick: Use min and max to restrict numeric input range [OK]
Common Mistakes:
MISTAKES
  • Ignoring max attribute effect
  • Assuming any number is valid
  • Confusing min and max values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes