diff --git a/modules/@angular/common/src/directives/ng_class.ts b/modules/@angular/common/src/directives/ng_class.ts index 24431cb592..7f96c75fe7 100644 --- a/modules/@angular/common/src/directives/ng_class.ts +++ b/modules/@angular/common/src/directives/ng_class.ts @@ -9,7 +9,7 @@ import {Directive, DoCheck, ElementRef, Input, IterableChanges, IterableDiffer, IterableDiffers, KeyValueChanges, KeyValueDiffer, KeyValueDiffers, Renderer} from '@angular/core'; import {isListLikeIterable} from '../facade/collection'; -import {isPresent, stringify} from '../facade/lang'; +import {stringify} from '../facade/lang'; /** * @ngModule CommonModule @@ -129,7 +129,7 @@ export class NgClass implements DoCheck { (rawClassVal).forEach((klass: string) => this._toggleClass(klass, !isCleanup)); } else { Object.keys(rawClassVal).forEach(klass => { - if (isPresent(rawClassVal[klass])) this._toggleClass(klass, !isCleanup); + if (rawClassVal[klass] != null) this._toggleClass(klass, !isCleanup); }); } } diff --git a/modules/@angular/common/src/pipes/i18n_plural_pipe.ts b/modules/@angular/common/src/pipes/i18n_plural_pipe.ts index eb8778d71c..50c1644abf 100644 --- a/modules/@angular/common/src/pipes/i18n_plural_pipe.ts +++ b/modules/@angular/common/src/pipes/i18n_plural_pipe.ts @@ -7,7 +7,6 @@ */ import {Pipe, PipeTransform} from '@angular/core'; -import {isBlank} from '../facade/lang'; import {NgLocalization, getPluralCategory} from '../localization'; import {InvalidPipeArgumentError} from './invalid_pipe_argument_error'; @@ -35,7 +34,7 @@ export class I18nPluralPipe implements PipeTransform { constructor(private _localization: NgLocalization) {} transform(value: number, pluralMap: {[count: string]: string}): string { - if (isBlank(value)) return ''; + if (value == null) return ''; if (typeof pluralMap !== 'object' || pluralMap === null) { throw new InvalidPipeArgumentError(I18nPluralPipe, pluralMap); diff --git a/modules/@angular/common/src/pipes/number_pipe.ts b/modules/@angular/common/src/pipes/number_pipe.ts index fbfe98750e..2383de09de 100644 --- a/modules/@angular/common/src/pipes/number_pipe.ts +++ b/modules/@angular/common/src/pipes/number_pipe.ts @@ -8,7 +8,7 @@ import {Inject, LOCALE_ID, Pipe, PipeTransform, Type} from '@angular/core'; -import {NumberWrapper, isBlank, isPresent} from '../facade/lang'; +import {NumberWrapper} from '../facade/lang'; import {NumberFormatStyle, NumberFormatter} from './intl'; import {InvalidPipeArgumentError} from './invalid_pipe_argument_error'; @@ -18,7 +18,7 @@ const _NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/; function formatNumber( pipe: Type, locale: string, value: number | string, style: NumberFormatStyle, digits: string, currency: string = null, currencyAsSymbol: boolean = false): string { - if (isBlank(value)) return null; + if (value == null) return null; // Convert strings to numbers value = typeof value === 'string' && NumberWrapper.isNumeric(value) ? +value : value; @@ -41,13 +41,13 @@ function formatNumber( if (parts === null) { throw new Error(`${digits} is not a valid digit info for number pipes`); } - if (isPresent(parts[1])) { // min integer digits + if (parts[1] != null) { // min integer digits minInt = NumberWrapper.parseIntAutoRadix(parts[1]); } - if (isPresent(parts[3])) { // min fraction digits + if (parts[3] != null) { // min fraction digits minFraction = NumberWrapper.parseIntAutoRadix(parts[3]); } - if (isPresent(parts[5])) { // max fraction digits + if (parts[5] != null) { // max fraction digits maxFraction = NumberWrapper.parseIntAutoRadix(parts[5]); } } diff --git a/modules/@angular/common/src/pipes/slice_pipe.ts b/modules/@angular/common/src/pipes/slice_pipe.ts index 0473a7fd4b..829add188f 100644 --- a/modules/@angular/common/src/pipes/slice_pipe.ts +++ b/modules/@angular/common/src/pipes/slice_pipe.ts @@ -7,7 +7,6 @@ */ import {Pipe, PipeTransform} from '@angular/core'; -import {isBlank} from '../facade/lang'; import {InvalidPipeArgumentError} from './invalid_pipe_argument_error'; /** @@ -58,7 +57,7 @@ import {InvalidPipeArgumentError} from './invalid_pipe_argument_error'; @Pipe({name: 'slice', pure: false}) export class SlicePipe implements PipeTransform { transform(value: any, start: number, end?: number): any { - if (isBlank(value)) return value; + if (value == null) return value; if (!this.supports(value)) { throw new InvalidPipeArgumentError(SlicePipe, value);