I want to add the style for the section which I am going to print.
let popupWinindow
let innerContents = this.printDiv.nativeElement.innerHTML;
popupWinindow = window.open('', '_blank', 'top=0,left=0,height=100%,width=auto');
popupWinindow.document.open();
popupWinindow.document.write('<html><head><link href="styles.css" rel="stylesheet" type="text/css"></head><body onload="window.print();">' + innerContents + '</html>');
popupWinindow.document.close();
When I am adding styles internally in the style tag then everything works fine. But when I tried to add it in external way it does not apply to the printDiv.
This is the error I have in console.
Refused to apply style from 'http://localhost:4200/styles.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.