@rxap/forms
Version:
This package provides a set of tools and directives to simplify working with Angular forms, including reactive forms, custom validators, and form directives for handling loading, submitting, and error states. It offers decorators for defining forms and co
47 lines (41 loc) • 32.4 kB
HTML
<html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ControlValueAccessor | @rxap/forms - v19.1.0</title><meta name="description" content="Documentation for @rxap/forms"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@rxap/forms - v19.1.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@rxap/forms</a></li><li><a href="ControlValueAccessor.html">ControlValueAccessor</a></li></ul><h1>Class ControlValueAccessor<T><code class="tsd-tag">Abstract</code></h1></div> <section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="t" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span> = <span class="tsd-signature-type">any</span></span></li></ul></section> <section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><span class="tsd-signature-type">ControlValueAccessor</span></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://gitlab.com/rxap/packages/-/blob/36b0e9732b24717840935712e316593ff6aba795/packages/angular/forms/src/lib/control-value-accessor.ts#L3">packages/angular/forms/src/lib/control-value-accessor.ts:3</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="ControlValueAccessor.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="ControlValueAccessor.html#onchange" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Change?</span></a>
<a href="ControlValueAccessor.html#ontouched" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Touched?</span></a>
<a href="ControlValueAccessor.html#registeronchange" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>register<wbr/>On<wbr/>Change</span></a>
<a href="ControlValueAccessor.html#registerontouched" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>register<wbr/>On<wbr/>Touched</span></a>
<a href="ControlValueAccessor.html#setdisabledstate" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Disabled<wbr/>State?</span></a>
<a href="ControlValueAccessor.html#writevalue" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Value</span></a>
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorcontrolvalueaccessor" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">ControlValueAccessor</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ControlValueAccessor.html#constructorcontrolvalueaccessort">T</a> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="ControlValueAccessor.html" class="tsd-signature-type tsd-kind-class">ControlValueAccessor</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ControlValueAccessor.html#constructorcontrolvalueaccessort">T</a><span class="tsd-signature-symbol">></span><a href="#constructorcontrolvalueaccessor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="constructorcontrolvalueaccessort" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span> = <span class="tsd-signature-type">any</span></span></li></ul></section><h4 class="tsd-returns-title">Returns <a href="ControlValueAccessor.html" class="tsd-signature-type tsd-kind-class">ControlValueAccessor</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ControlValueAccessor.html#constructorcontrolvalueaccessort">T</a><span class="tsd-signature-symbol">></span></h4></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="onchange" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Optional</code><span>on<wbr/>Change</span><a href="#onchange" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="onchange-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">onChange</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">value</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span> <span class="tsd-signature-symbol">|</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="ControlValueAccessor.html#constructorcontrolvalueaccessort">T</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#onchange-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">value</span>: <span class="tsd-signature-type">null</span> <span class="tsd-signature-symbol">|</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="ControlValueAccessor.html#constructorcontrolvalueaccessort">T</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://gitlab.com/rxap/packages/-/blob/36b0e9732b24717840935712e316593ff6aba795/packages/angular/forms/src/lib/control-value-accessor.ts#L7">packages/angular/forms/src/lib/control-value-accessor.ts:7</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="ontouched" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Optional</code><span>on<wbr/>Touched</span><a href="#ontouched" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="ontouched-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">onTouched</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#ontouched-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://gitlab.com/rxap/packages/-/blob/36b0e9732b24717840935712e316593ff6aba795/packages/angular/forms/src/lib/control-value-accessor.ts#L11">packages/angular/forms/src/lib/control-value-accessor.ts:11</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="registeronchange" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>register<wbr/>On<wbr/>Change</span><a href="#registeronchange" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="registeronchange-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">registerOnChange</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">fn</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">value</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span> <span class="tsd-signature-symbol">|</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="ControlValueAccessor.html#constructorcontrolvalueaccessort">T</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#registeronchange-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">fn</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">value</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span> <span class="tsd-signature-symbol">|</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="ControlValueAccessor.html#constructorcontrolvalueaccessort">T</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></span><div class="tsd-comment tsd-typography"><p>The callback function to register</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-description"><h4 class="tsd-anchor-link"><a id="description" class="tsd-anchor"></a>Description<a href="#description" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Registers a callback function that is called when the control's value
changes in the UI.</p>
<p>This method is called by the forms API on initialization to update the form
model when values propagate from the view to the model.</p>
<p>When implementing the <code>registerOnChange</code> method in your own value accessor,
save the given function so your class calls it at the appropriate time.</p>
</div><div class="tsd-tag-usageNotes"><h4 class="tsd-anchor-link"><a id="usage-notes" class="tsd-anchor"></a>Usage Notes<a href="#usage-notes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><a id="store-the-change-function" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Store the change function<a href="#store-the-change-function" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The following example stores the provided function as an internal method.</p>
<pre><code class="ts"><span class="hl-0">registerOnChange</span><span class="hl-1">(</span><span class="hl-3">fn</span><span class="hl-1">: (</span><span class="hl-3">_</span><span class="hl-1">: </span><span class="hl-4">any</span><span class="hl-1">) </span><span class="hl-5">=></span><span class="hl-1"> </span><span class="hl-5">void</span><span class="hl-1">): </span><span class="hl-5">void</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">this</span><span class="hl-1">.</span><span class="hl-3">_onChange</span><span class="hl-1"> = </span><span class="hl-3">fn</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
</code><button type="button">Copy</button></pre>
<p>When the value changes in the UI, call the registered
function to allow the forms API to update itself:</p>
<pre><code class="ts"><span class="hl-6">host</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-2">'(change)'</span><span class="hl-1">: </span><span class="hl-2">'_onChange($event.target.value)'</span><br/><span class="hl-1">}</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><p>Implementation of NgControlValueAccessor.registerOnChange</p><ul><li>Defined in <a href="https://gitlab.com/rxap/packages/-/blob/36b0e9732b24717840935712e316593ff6aba795/packages/angular/forms/src/lib/control-value-accessor.ts#L14">packages/angular/forms/src/lib/control-value-accessor.ts:14</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="registerontouched" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>register<wbr/>On<wbr/>Touched</span><a href="#registerontouched" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="registerontouched-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">registerOnTouched</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">fn</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#registerontouched-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">fn</span>: <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></span><div class="tsd-comment tsd-typography"><p>The callback function to register</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-description"><h4 class="tsd-anchor-link"><a id="description-1" class="tsd-anchor"></a>Description<a href="#description-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Registers a callback function that is called by the forms API on initialization
to update the form model on blur.</p>
<p>When implementing <code>registerOnTouched</code> in your own value accessor, save the given
function so your class calls it when the control should be considered
blurred or "touched".</p>
</div><div class="tsd-tag-usageNotes"><h4 class="tsd-anchor-link"><a id="usage-notes-1" class="tsd-anchor"></a>Usage Notes<a href="#usage-notes-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><a id="store-the-callback-function" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Store the callback function<a href="#store-the-callback-function" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The following example stores the provided function as an internal method.</p>
<pre><code class="ts"><span class="hl-0">registerOnTouched</span><span class="hl-1">(</span><span class="hl-3">fn</span><span class="hl-1">: </span><span class="hl-3">any</span><span class="hl-1">): </span><span class="hl-5">void</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">this</span><span class="hl-1">.</span><span class="hl-3">_onTouched</span><span class="hl-1"> = </span><span class="hl-3">fn</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
</code><button type="button">Copy</button></pre>
<p>On blur (or equivalent), your class should call the registered function to allow
the forms API to update itself:</p>
<pre><code class="ts"><span class="hl-6">host</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-2">'(blur)'</span><span class="hl-1">: </span><span class="hl-2">'_onTouched()'</span><br/><span class="hl-1">}</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><p>Implementation of NgControlValueAccessor.registerOnTouched</p><ul><li>Defined in <a href="https://gitlab.com/rxap/packages/-/blob/36b0e9732b24717840935712e316593ff6aba795/packages/angular/forms/src/lib/control-value-accessor.ts#L18">packages/angular/forms/src/lib/control-value-accessor.ts:18</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="setdisabledstate" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Optional</code><span>set<wbr/>Disabled<wbr/>State</span><a href="#setdisabledstate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="setdisabledstate-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">setDisabledState</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">isDisabled</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#setdisabledstate-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">isDisabled</span>: <span class="tsd-signature-type">boolean</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><p>Implementation of NgControlValueAccessor.setDisabledState</p><ul><li>Defined in <a href="https://gitlab.com/rxap/packages/-/blob/36b0e9732b24717840935712e316593ff6aba795/packages/angular/forms/src/lib/control-value-accessor.ts#L23">packages/angular/forms/src/lib/control-value-accessor.ts:23</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writevalue" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Abstract</code><span>write<wbr/>Value</span><a href="#writevalue" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writevalue-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writeValue</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">value</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="ControlValueAccessor.html#constructorcontrolvalueaccessort">T</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#writevalue-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">value</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="ControlValueAccessor.html#constructorcontrolvalueaccessort">T</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-description"><h4 class="tsd-anchor-link"><a id="description-2" class="tsd-anchor"></a>Description<a href="#description-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Writes a new value to the element.</p>
<p>This method is called by the forms API to write to the view when programmatic
changes from model to view are requested.</p>
</div><div class="tsd-tag-usageNotes"><h4 class="tsd-anchor-link"><a id="usage-notes-2" class="tsd-anchor"></a>Usage Notes<a href="#usage-notes-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><a id="write-a-value-to-the-element" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Write a value to the element<a href="#write-a-value-to-the-element" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The following example writes a value to the native DOM element.</p>
<pre><code class="ts"><span class="hl-0">writeValue</span><span class="hl-1">(</span><span class="hl-3">value</span><span class="hl-1">: </span><span class="hl-3">any</span><span class="hl-1">): </span><span class="hl-5">void</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">this</span><span class="hl-1">.</span><span class="hl-3">_renderer</span><span class="hl-1">.</span><span class="hl-0">setProperty</span><span class="hl-1">(</span><span class="hl-5">this</span><span class="hl-1">.</span><span class="hl-3">_elementRef</span><span class="hl-1">.</span><span class="hl-3">nativeElement</span><span class="hl-1">, </span><span class="hl-2">'value'</span><span class="hl-1">, </span><span class="hl-3">value</span><span class="hl-1">);</span><br/><span class="hl-1">}</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><p>Implementation of NgControlValueAccessor.writeValue</p><ul><li>Defined in <a href="https://gitlab.com/rxap/packages/-/blob/36b0e9732b24717840935712e316593ff6aba795/packages/angular/forms/src/lib/control-value-accessor.ts#L4">packages/angular/forms/src/lib/control-value-accessor.ts:4</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#onchange" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Change</span></a><a href="#ontouched" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Touched</span></a><a href="#registeronchange" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>register<wbr/>On<wbr/>Change</span></a><ul><li><ul><li><ul><li><a href="#store-the-change-function"><span>Store the change function</span></a></li></ul></li></ul></li></ul><a href="#registerontouched" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>register<wbr/>On<wbr/>Touched</span></a><ul><li><ul><li><ul><li><a href="#store-the-callback-function"><span>Store the callback function</span></a></li></ul></li></ul></li></ul><a href="#setdisabledstate" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Disabled<wbr/>State</span></a><a href="#writevalue" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Value</span></a><ul><li><a href="#write-a-value-to-the-element"><span>Write a value to the element</span></a></li></ul></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@rxap/forms - v19.1.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>