saveas angular 6

JavaScript
import { saveAs } from 'file-saver';

FileSaver saveAs(Blob/File/Url, optional DOMString filename, optional Object { autoBom })

Source

Also in JavaScript: