IDENTIFY THE ERROR:
printContents = document.getElementById('print').innerHTML.toString();
ON LINE 4:
print(): void {
let printContents!: string;
let popupWin!: any;
printContents = document.getElementById('print').innerHTML.toString();
printContents = ((printContents as string) + '').replace('col-sm', 'col-xs');
popupWin = window.open('', '_blank', 'top=0,left=0,height=100%,width=auto');
popupWin.document.open();
popupWin.document.write(`<html lang="fa"><body onload="window.print();">${printContents}</body></html>`);
popupWin.document.close();}