MCPcopy Create free account
hub / github.com/angular/components / init

Method init

src/cdk-experimental/popover-edit/edit-ref.ts:47–59  ·  view source on GitHub ↗

* Called by the host directive's OnInit hook. Reads the initial state of the * form and overrides it with persisted state from previous openings, if * applicable.

(previousFormValue: FormValue | undefined)

Source from the content-addressed store, hash-verified

45 * applicable.
46 */
47 init(previousFormValue: FormValue | undefined): void {
48 // Wait for the next render before caching the initial value.
49 // This ensures that all form controls have been initialized.
50 afterNextRender(
51 () => {
52 this.updateRevertValue();
53 if (previousFormValue) {
54 this.reset(previousFormValue);
55 }
56 },
57 {injector: this._injector},
58 );
59 }
60
61 ngOnDestroy(): void {
62 this._editEventDispatcher.unsetActiveEditRef(this);

Callers 1

ngOnInitMethod · 0.45

Calls 2

updateRevertValueMethod · 0.95
resetMethod · 0.95

Tested by

no test coverage detected