Angular 4 does not support having multiple constructors, so I need to find a cleaner way to instantiate my object.
This is what my model looks like:
export class SrcFilter {
constructor(public firstList?: Array<String>, public secondList?: Array<String>, public thirdList?: Array<String>,
public fourthList?: Array<String>, public fifthList?: Array<String>, public sixthList?: Array<String>) {
}
}
Currently, I have to instantiate it like this:
allFilters: SrcFilter = new SrcFilter([], [], [], [], [], []);
Having to initialize six lists is not ideal. I tried adding a second empty constructor to be able to do something like:
new SrcFilter()
However, Angular complains about having multiple constructor implementations.