diff --git a/packages/common/http/src/xhr.ts b/packages/common/http/src/xhr.ts index 9dc01058b6..339a7cc739 100644 --- a/packages/common/http/src/xhr.ts +++ b/packages/common/http/src/xhr.ts @@ -231,7 +231,7 @@ export class HttpXhrBackend implements HttpBackend { // The onError callback is called when something goes wrong at the network level. // Connection timeout, DNS error, offline, etc. These are actual errors, and are // transmitted on the error channel. - const onError = (error: ErrorEvent) => { + const onError = (error: ProgressEvent) => { const {url} = partialFromXhr(); const res = new HttpErrorResponse({ error, diff --git a/packages/common/src/directives/ng_for_of.ts b/packages/common/src/directives/ng_for_of.ts index 08feff2183..04276d92d1 100644 --- a/packages/common/src/directives/ng_for_of.ts +++ b/packages/common/src/directives/ng_for_of.ts @@ -216,15 +216,18 @@ export class NgForOf implements DoCheck { private _applyChanges(changes: IterableChanges) { const insertTuples: RecordViewTuple[] = []; changes.forEachOperation( - (item: IterableChangeRecord, adjustedPreviousIndex: number, currentIndex: number) => { + (item: IterableChangeRecord, adjustedPreviousIndex: number | null, + currentIndex: number | null) => { if (item.previousIndex == null) { const view = this._viewContainer.createEmbeddedView( - this._template, new NgForOfContext(null !, this._ngForOf, -1, -1), currentIndex); + this._template, new NgForOfContext(null !, this._ngForOf, -1, -1), + currentIndex === null ? undefined : currentIndex); const tuple = new RecordViewTuple(item, view); insertTuples.push(tuple); } else if (currentIndex == null) { - this._viewContainer.remove(adjustedPreviousIndex); - } else { + this._viewContainer.remove( + adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex); + } else if (adjustedPreviousIndex !== null) { const view = this._viewContainer.get(adjustedPreviousIndex) !; this._viewContainer.move(view, currentIndex); const tuple = new RecordViewTuple(item, >>view); diff --git a/packages/common/src/i18n/format_date.ts b/packages/common/src/i18n/format_date.ts index fe25660e44..b5df8175b3 100644 --- a/packages/common/src/i18n/format_date.ts +++ b/packages/common/src/i18n/format_date.ts @@ -378,7 +378,7 @@ function weekGetter(size: number, monthBased = false): DateFormatter { }; } -type DateFormatter = (date: Date, locale: string, offset?: number) => string; +type DateFormatter = (date: Date, locale: string, offset: number) => string; const DATE_FORMATS: {[format: string]: DateFormatter} = {}; diff --git a/packages/upgrade/src/common/src/angular1.ts b/packages/upgrade/src/common/src/angular1.ts index 78832354f0..efe8d0bd59 100644 --- a/packages/upgrade/src/common/src/angular1.ts +++ b/packages/upgrade/src/common/src/angular1.ts @@ -117,8 +117,7 @@ export interface ITranscludeFunction { (cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery; } export interface ICloneAttachFunction { - // Let's hint but not force cloneAttachFn's signature - (clonedElement?: IAugmentedJQuery, scope?: IScope): any; + (clonedElement: IAugmentedJQuery, scope: IScope): any; } export type IAugmentedJQuery = Node[] & { on?: (name: string, fn: () => void) => void;