From 3ca6852d2237113bbb29e15ca570dbbd5466fc3f Mon Sep 17 00:00:00 2001 From: Christian Crowhurst Date: Wed, 21 Dec 2016 18:34:35 +0000 Subject: [PATCH] fix(ngTableParams): `parameters` method returns incorrect object `parameters` method when called without arguments should return the current `ParamValues`, but instead is returning a reference to `this` --- src/core/ngTableParams.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ngTableParams.ts b/src/core/ngTableParams.ts index b21f9f9d..224d01e1 100644 --- a/src/core/ngTableParams.ts +++ b/src/core/ngTableParams.ts @@ -385,7 +385,7 @@ export class NgTableParams { parameters(newParameters?: ParamValues | { [name: string]: string }, parseParamsFromUrl?: boolean): this parameters(newParameters?: ParamValues | { [name: string]: string }, parseParamsFromUrl?: boolean): ParamValues | this { parseParamsFromUrl = parseParamsFromUrl || false; - if (typeof newParameters !== undefined) { + if (newParameters !== undefined) { for (const key in newParameters) { let value = newParameters[key]; if (parseParamsFromUrl && key.indexOf('[') >= 0) {