After the update from the angular 5.1 to 6.1 I stared to receive some error from my code like the following:
Error: ngc compilation failed: components/forms/utils.ts(5,3): error TS2322: Type '[number] | [number, number, number, number]' is not assignable to type '[number]'.
Follows the code:
export function bsColumnClass(sizes: [number]) {
let sizebs = ['col-xs-', 'col-sm-', 'col-md-', 'col-lg-',];
sizes = sizes || [12, 12, 12, 12];
let className = sizes.map(function callback(value, index, array) {
return sizebs[index].concat(value.toString());
}).join(" ");
return className;
}
I notice that the problem is because I have a function parameter sizes: [number] and after that I'm traing to do this line of code: sizes = sizes || [12, 12, 12, 12];
Can you tell me the better way to solve this?