angular/packages/core/src
Kristiyan Kostadinov 702ab28b4c feat(core): add support for model inputs (#54252)
Adds support for model inputs in the framework. `model()` returns a writable signal that implicitly defines a input/output pair that can be used either in two-way bindings to keep two values in sync or by binding individually to the input and output. When the value of the `model` changes, it will emit an event with the current value.

Furthermore, these changes expand two-way bindings to accept `WritableSignal`. This will make it easier to transition existing code to signals in a backwards-compatible way.

Example:

```ts
@Directive({
  selector: 'counter',
  standalone: true,
  host: {
    '(click)': 'increment()',
  }
})
export class Counter {
  value = model(0);

  increment(): void {
    this.value.update(current => current + 1);
  }
}

@Component({
  template: `<counter [(value)]="count"/> The current count is: {{count()}}`,
})
class App {
  count = signal(0);
}
```

PR Close #54252
2024-02-07 16:36:09 +00:00
..
application refactor(core): pull compileNgModuleFactory out of application_ref (#54103) 2024-02-06 15:04:36 +00:00
authoring refactor(core): add model implementation (#54252) 2024-02-07 16:36:01 +00:00
change_detection refactor(core): race rAF and setTimeout in zoneless scheduler (#54023) 2024-01-24 18:39:15 -05:00
compiler refactor(compiler): support JIT for signal-based queries (#54019) 2024-01-24 16:13:31 +01:00
debug refactor(core): cleanup DebugElement (#50896) 2023-10-13 12:24:15 +02:00
defer refactor(core): avoid reusing argument name as a local const (#54239) 2024-02-05 15:15:17 +00:00
di refactor(core): break circular dependencies in preparation for queries as signals (#54103) 2024-02-06 15:04:36 +00:00
hydration refactor(core): break circular dependencies in preparation for queries as signals (#54103) 2024-02-06 15:04:36 +00:00
i18n refactor(core): remove InjectionToken descriptions in optimized builds. (#53747) 2024-01-26 19:12:41 +00:00
interface build: configure cross-pkg resolution for api extraction (#52499) 2024-01-05 11:27:34 -08:00
linker refactor(core): remove InjectionToken descriptions in optimized builds. (#53747) 2024-01-26 19:12:41 +00:00
metadata docs(core): fix example sections (#54121) 2024-01-31 15:22:30 +00:00
platform refactor(core): pull compileNgModuleFactory out of application_ref (#54103) 2024-02-06 15:04:36 +00:00
reflection build: configure cross-pkg resolution for api extraction (#52499) 2024-01-05 11:27:34 -08:00
render refactor(animations): make AnimationBuilder tree-shakable (#52097) 2023-10-12 18:13:22 +02:00
render3 refactor(compiler-cli): allow writable signals in two-way bindings (#54252) 2024-02-07 16:36:07 +00:00
sanitization feat(core): change the URL sanitization to only block javascript: URLs (#49659) 2023-04-04 15:01:13 -07:00
testability refactor(core): Remove internal-only testability features (#53767) 2024-01-09 14:46:46 -08:00
util refactor(docs): fix typo (#54247) 2024-02-05 15:05:36 +00:00
view refactor: remove unnecessary file (#49042) 2023-02-17 11:08:33 -08:00
zone refactor(core): Use single source of truth for ApplicationRef.isStable (#53576) 2023-12-19 12:42:45 -08:00
authoring.ts feat(core): add support for model inputs (#54252) 2024-02-07 16:36:09 +00:00
change_detection.ts perf(core): remove support for the deprecated WrappedValue (#43507) 2021-10-01 12:25:19 -04:00
console.ts refactor(core): make platform core providers tree-shakable (#45506) 2022-04-12 22:28:23 +00:00
core.externs.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
core.ts feat(core): add support for model inputs (#54252) 2024-02-07 16:36:09 +00:00
core_private_export.ts refactor(devtools): Add hydration informations (#53910) 2024-01-30 20:03:14 +00:00
core_reactivity_export.ts feat(core): add Angular Signals to the public API (#49150) 2023-02-22 11:27:21 -08:00
core_reactivity_export_internal.ts refactor(compiler-cli): allow writable signals in two-way bindings (#54252) 2024-02-07 16:36:07 +00:00
core_render3_private_export.ts refactor(core): break circular dependencies in preparation for queries as signals (#54103) 2024-02-06 15:04:36 +00:00
di.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
error_details_base_url.ts docs: extract XSS security doc URL into a constant (#48082) 2022-11-17 13:21:16 -08:00
error_handler.ts refactor(core): Move code out of application_ref (#53371) 2023-12-08 14:29:46 -08:00
errors.ts refactor(core): add model implementation (#54252) 2024-02-07 16:36:01 +00:00
event_emitter.ts build: update rxjs build version to v7 (#53500) 2023-12-18 16:25:37 +00:00
image_performance_warning.ts refactor(core): Separate application and platform files even more (#53371) 2023-12-08 14:29:46 -08:00
linker.ts feat(core): introduce concept of DestroyRef (#49158) 2023-02-28 11:52:09 -08:00
metadata.ts refactor: fix a number of typos throughout the codebase (#52249) 2023-10-25 16:51:24 -07:00
pending_tasks.ts refactor(core): Use single source of truth for ApplicationRef.isStable (#53576) 2023-12-19 12:42:45 -08:00
r3_symbols.ts refactor(compiler): apply component metadata asynchronously when defer blocks are present (#51182) 2023-08-15 11:32:09 -07:00
render.ts refactor(core): clean up circular dependencies (#39722) 2020-11-18 09:15:29 -08:00
transfer_state.ts refactor(core): Separate application and platform files even more (#53371) 2023-12-08 14:29:46 -08:00
version.ts fix(core): avoid repeated work when parsing version (#53598) 2023-12-18 16:26:36 +00:00
zone.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00