mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Adds support for marking a directive input as required. During template type checking, the compiler will verify that all required inputs have been specified and will raise a diagnostic if one or more are missing. Some specifics: * Inputs are marked as required by passing an object literal with a `required: true` property to the `Input` decorator or into the `inputs` array. * Required inputs imply that the directive can't work without them. This is why there's a new check that enforces that all required inputs of a host directive are exposed on the host. * Required input diagnostics are reported through the `OutOfBandDiagnosticRecorder`, rather than generating a new structure in the TCB, because it allows us to provide a better error message. * Currently required inputs are only supported during AOT compilation, because knowing which bindings are present during JIT can be tricky and may lead to increased bundle sizes. Fixes #37706. PR Close #49304 |
||
|---|---|---|
| .. | ||
| BUILD.bazel | ||
| component_indexing_spec.ts | ||
| env.ts | ||
| extended_template_diagnostics_spec.ts | ||
| host_directives_spec.ts | ||
| imports_spec.ts | ||
| incremental_error_spec.ts | ||
| incremental_semantic_changes_spec.ts | ||
| incremental_spec.ts | ||
| incremental_typecheck_spec.ts | ||
| ls_typecheck_helpers_spec.ts | ||
| monorepo_spec.ts | ||
| ngtsc_spec.ts | ||
| scope_spec.ts | ||
| sourcemap_utils.ts | ||
| standalone_spec.ts | ||
| template_mapping_spec.ts | ||
| template_typecheck_spec.ts | ||
| util.ts | ||
| xi18n_spec.ts | ||