mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(core): input coercion (#42803)
BREAKING CHANGE: Forms [email] input coercion Forms [email] input value will be considered as true if it is defined with any value rather than false and 'false'. PR Close #42803
This commit is contained in:
committed by
Dylan Hunn
parent
db6cf7e7c1
commit
d5719c2e0f
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
import {Observable} from 'rxjs';
|
||||
|
||||
import {Inject, Injectable, InjectionToken, Optional} from './di';
|
||||
import {isObservable, isPromise} from './util/lang';
|
||||
import {noop} from './util/noop';
|
||||
|
||||
@@ -15,8 +15,7 @@ export {SimpleChange, SimpleChanges} from '../interface/simple_change';
|
||||
export {devModeEqual} from './change_detection_util';
|
||||
export {ChangeDetectorRef} from './change_detector_ref';
|
||||
export {ChangeDetectionStrategy, ChangeDetectorStatus, isDefaultChangeDetectionStrategy} from './constants';
|
||||
export {DefaultIterableDifferFactory} from './differs/default_iterable_differ';
|
||||
export {DefaultIterableDiffer} from './differs/default_iterable_differ';
|
||||
export {DefaultIterableDiffer, DefaultIterableDifferFactory} from './differs/default_iterable_differ';
|
||||
export {DefaultKeyValueDifferFactory} from './differs/default_keyvalue_differ';
|
||||
export {IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, IterableDiffers, NgIterable, TrackByFunction} from './differs/iterable_differs';
|
||||
export {KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory, KeyValueDiffers} from './differs/keyvalue_differs';
|
||||
|
||||
@@ -26,6 +26,7 @@ export {GetterFn as ɵGetterFn, MethodFn as ɵMethodFn, SetterFn as ɵSetterFn}
|
||||
export {allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, BypassType as ɵBypassType, getSanitizationBypassType as ɵgetSanitizationBypassType, SafeHtml as ɵSafeHtml, SafeResourceUrl as ɵSafeResourceUrl, SafeScript as ɵSafeScript, SafeStyle as ɵSafeStyle, SafeUrl as ɵSafeUrl, SafeValue as ɵSafeValue, unwrapSafeValue as ɵunwrapSafeValue} from './sanitization/bypass';
|
||||
export {_sanitizeHtml as ɵ_sanitizeHtml} from './sanitization/html_sanitizer';
|
||||
export {_sanitizeUrl as ɵ_sanitizeUrl} from './sanitization/url_sanitizer';
|
||||
export {coerceToBoolean as ɵcoerceToBoolean} from './util/coercion';
|
||||
export {makeDecorator as ɵmakeDecorator} from './util/decorators';
|
||||
export {global as ɵglobal} from './util/global';
|
||||
export {isObservable as ɵisObservable, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable} from './util/lang';
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
*/
|
||||
|
||||
import {Type} from '../interface/type';
|
||||
|
||||
import {PlatformReflectionCapabilities} from './platform_reflection_capabilities';
|
||||
import {GetterFn, MethodFn, SetterFn} from './types';
|
||||
|
||||
export {PlatformReflectionCapabilities};
|
||||
export {GetterFn, MethodFn, SetterFn};
|
||||
export {GetterFn, MethodFn, PlatformReflectionCapabilities, SetterFn};
|
||||
|
||||
/**
|
||||
* Provides access to reflection data about symbols. Used internally by Angular
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
import '../util/ng_dev_mode';
|
||||
|
||||
import {assertDefined, assertDomNode} from '../util/assert';
|
||||
|
||||
import {EMPTY_ARRAY} from '../util/empty';
|
||||
|
||||
import {LContext} from './interfaces/context';
|
||||
import {TNode, TNodeFlags} from './interfaces/node';
|
||||
import {RElement, RNode} from './interfaces/renderer_dom';
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
/** Coerces a value (typically a string) to a boolean. */
|
||||
export function coerceToBoolean(value: unknown): boolean {
|
||||
return typeof value === 'boolean' ? value : (value != null && value !== 'false');
|
||||
}
|
||||
Reference in New Issue
Block a user