Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Angular’s NG0950 runtime error means code read a required input before Angular supplied its bound value. Move the read into a reactive context such as a template, computed, or effect, or wait until ngOnInit or later. Angular guarantees inputs are available from ngOnInit onward.

What NG0950 means

Angular describes the error as: “A required input was accessed but no value was bound.” The problem is usually when the input is read, not necessarily that the parent omitted it. Angular identifies reading a required input during class construction as a common cause. Angular’s NG0950 error reference explains the error and its recommended remedies.

Required inputs also create a contract between a component and the template that uses it. If a template omits a required input, Angular reports a build-time error. That check is distinct from NG0950: the build-time error concerns a missing binding, while NG0950 occurs when code accesses the input before its value is available.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Find the early read

  1. Find the required input declaration. A signal-based input can be declared with input.required<T>(); a decorator-based input can use @Input({required: true}). Angular documents these forms in its component inputs guide and Input API reference.

  2. Search for every place the input is read. Check field initializers and constructor code first, since these run before Angular has supplied the bound input value.

  3. Check the parent template to confirm it supplies the required binding. Angular’s required-input check reports an omitted input at build time.

  4. Move any early read to a context where the input is available, following the options below.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose a safe place to read the input

Use a reactive context when the result should follow input changes

Read the input in the template, or derive or respond to it with a computed or effect. This is suitable when the value is needed for rendering or when work should respond as the input changes. For signal-based inputs, call the signal to get its current value—for example, this.value().

Use ngOnInit or a later lifecycle point for imperative setup

When imperative code needs the initial value, read it in ngOnInit or later rather than during construction. Angular states that inputs are guaranteed to be available in ngOnInit and afterwards. Choose this approach when the work belongs in lifecycle code; use a reactive context when the result needs to track later changes.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Should you make the input optional?

Only make an input optional if the component’s actual contract allows callers to leave it out. If the value is required, preserve that contract and change the timing of the read. Making it optional does not address an early read when the component still depends on the value.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.