| .. | .. |
|---|
| 3 | 3 | import { Injectable } from '@angular/core'; |
|---|
| 4 | 4 | import { Http, RequestOptions, ResponseContentType, Response } from '@angular/http'; |
|---|
| 5 | 5 | import { SeCurisResourceServices } from './base'; |
|---|
| 6 | | -import * as saveAsFile from "file-saver"; |
|---|
| 6 | +import "file-saver"; |
|---|
| 7 | + |
|---|
| 8 | +declare var saveAs: FileSaver; |
|---|
| 7 | 9 | |
|---|
| 8 | 10 | export const LIC_STATUS = { |
|---|
| 9 | 11 | CREATED: 'CR', |
|---|
| .. | .. |
|---|
| 109 | 111 | return this.http.get(url).map((response : Response) => { |
|---|
| 110 | 112 | let filename = JSON.parse(response.headers.get('Content-Disposition').match(/".*"$/g)[0]); |
|---|
| 111 | 113 | let content = JSON.stringify(response.json(), null, 2); |
|---|
| 112 | | - saveAsFile( new Blob([ content ], { type : 'application/octet-stream' }), filename); |
|---|
| 114 | + saveAs( new Blob([ content ], { type : 'application/octet-stream' }), filename); |
|---|
| 113 | 115 | return Observable.of(true); |
|---|
| 114 | 116 | }).catch(err => super.processErrorResponse(err)); |
|---|
| 115 | 117 | } |
|---|