In <pagination-clab> if "tot" and "current-page" parameters are passed as strings (e.g. "10" and "1" instead of 10 and 1) all calculations with additions will fail because "+" is treated as "string concatenation operator" and not "sum operator"
Example:
_getEnd(c, pages) {
let last = pages.length - 1;
if(c >= last - (this.range / 2)) {
return last;
} else if(c <= (this.range / 2)) {
return this.range;
} else {
return c + (this.range / 2);
}
}
If c=5 and this.range=8 last row will return 5 + (8 / 2) = 9.
If c="5" and this.range=8 last row will return "5" + (8 / 2) = "54".
In
<pagination-clab>
if"tot"
and"current-page"
parameters are passed as strings (e.g. "10" and "1" instead of 10 and 1) all calculations with additions will fail because "+" is treated as "string concatenation operator" and not "sum operator"Example:
If
c=5
andthis.range=8
last row will return5 + (8 / 2) = 9
. Ifc="5"
andthis.range=8
last row will return"5" + (8 / 2) = "54"
.