The code below is functioning properly in all internet browsers except for IE11. When running the code in IE, an error is thrown stating "ERROR TypeError: Argument not optional." The project being developed is using Angular 10.
private togglePageClass(mode: boolean) {
if (mode) {
document.getElementById('templateHolder')['classList'].add(...this.pageClass);
} else {
document.getElementById('templateHolder')['classList'].remove(...this.pageClass);
}
}
The value of the page class is set as follows:
let Mode: string = this.pageLayout['settings']['mode'].split('-')[1];
if (this.pageLayout['template'] === 'landing_page') {
this.pageClass = [this.pageLayout['settings']['id'], 'page-landing'];
} else if (this.getConfig('configSettings')['100'] === 'on') {
if (this.pageLayout['settings']['mode'] === 'abc') {
this.pageClass = [this.pageLayout['settings']['id'], 'page-' + this.pageLayout['template'], Mode, 'a'];
} else if (this.pageLayout['settings']['mode'] === 'xyz') {
this.pageClass = [this.pageLayout['settings']['id'], 'page-' + this.pageLayout['template'], Mode, 'b'];
} else {
this.pageClass = [this.pageLayout['settings']['id'], 'page-' + this.pageLayout['template'], Mode];
}
} else {
this.pageClass = [this.pageLayout['settings']['id'], 'page-' + this.pageLayout['template'], Mode];
}
I have made all necessary changes in the angular json and related files based on Angular.io guidelines to ensure that the app runs properly in IE 11.