# Wijmo_Angular2_Directivebase.Wjoptions

## Content

<div class="content__tsd">
						<div style="display:flex;justify-content:space-between;align-items:center">
							<h1>
								WjOptions Class
							</h1>
						</div>
						<section class="tsd-comment">
							<div class="tsd-comment">
								<div class="lead">
									<p>Exposes global options for the Wijmo for Angular 2 interop.</p>
								</div>
							</div>
						</section>
						<section class="tsd-hierarchy">
							<h3>Heirarchy</h3>
							<ul class="tsd-hierarchy">
								<li>
									<span class="target">WjOptions</span>
								</li>
							</ul>
						</section>
						<section class="tsd-index-group">
							<section class="tsd-index-panel">
								<div class="tsd-index-content">
									<section class="tsd-index-section ">
										<div class="title">
											<div class="gc_api_tree-item_icon_img_wrapper">
												<div class="gc_api_tree-item_icon_img" data-expand="true">
												</div>
											</div>
											<h3>
												Properties
											</h3>
										</div>
										<ul class="tsd-index-list">
											<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="wijmo_angular2_directivebase.wjoptions.html#asyncbindings" class="tsd-kind-icon">async<wbr>Bindings</a></li>
										</ul>
									</section>
								</div>
							</section>
						</section>
						<section class="tsd-panel-group tsd-member-group ">
							<h2>Properties</h2>
							<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
								<a name="asyncbindings" class="tsd-anchor"></a>
								<h3><span class="tsd-flag ts-flagStatic">Static</span> asyncBindings</h3>
								<div class="tsd-signature tsd-kind-icon">async<wbr>Bindings<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
								<aside class="tsd-sources">
								</aside>
								<div class="tsd-comment">
									<div class="lead">
										<p>Indicates whether Wijmo components update binding sources of the two-way bound properties asynchronously
										or synchronously.</p>
									</div>
									<p>If this property is set to true (default) then changes to the Wijmo components' properties
										with two-way bindings (like WjInputNumber.value) will cause the component to update a binding
										source property asynchronously, after the current change detection cycle is completed.
										Otherwise, if this property is set to false, the binding source will be updated immediately.
										A corresponding property change event (like WjInputNumber.valueChanged) is also triggered
										asynchronously or synchronously depending on this property value, after the binding source
									was updated.</p>
									<p>This global setting can be changed for specific instances of Wijmo components, by assigning
									the component's <b>asyncBindings</b> property with a specific boolean value.</p>
									<p>Transition to asynchronous binding source updates has happened in Wijmo version 350. Before that version,
										binding sources were updated immediately after the component's property change. In some cases this
										could lead to the <b>ExpressionChangedAfterItHasBeenCheckedError</b> exception in the applications running
										Angular in the debug mode. For example, if your component's property value is set to 0.12345, and
										you two-way bind it to the <b>value</b> property of the <b>WjInputNumber</b> component with the <b>format</b>
										property set to <b>'n2'</b>, the WjInputNumber immediately converts this value to 0.12. This change,
										in turn, causes Angular to update your component property (the source of this binding), so that its
										value changes from 0.12345 to 0.12. If this source update is performed synchronously then the binding
										source property changes its value during the same change detection cycle, which is prohibited by Angular.
										If Angular runs in debug mode then it executes a special check after every change detection cycle, which
										detects this change and raises the <b>ExpressionChangedAfterItHasBeenCheckedError</b> exception.
										Asynchronous binding source updates resolve this problem, because the binding source property
									is updated after the current change detection cycle has finished.</p>
									<p>If the <b>ExpressionChangedAfterItHasBeenCheckedError</b> is not an issue for you, and parts of
										you application logic are sensible to a moment when binding source update happens, you can change
										this functionality by setting the global <b>asyncBindings</b> property to false. This should be
										done before the first Wijmo component was instantiated by your application logic, and the best
										place to do it is the file where you declare the application's root NgModule. This can be done
									with the code like this:</p>
									<pre>import * as wjBase from 'wijmo/wijmo.angular2.directivebase';
wjBase.WjOptions.asyncBindings = false;</pre>
									<p>Alternatively, you can change the update mode for the specific component using its own
									<b>asyncBindings</b> property. For example:</p>
									<pre>&lt;wj-input-number [asyncBindings]="false" [(value)]="amount"&gt;&lt;/wj-input-number&gt;</pre>
								</div>
							</section>
						</section>
					</div>