Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import {Injectable} from '@angular/core';
  2. import {HttpClient} from '@angular/common/http';
  3.  
  4. @Injectable({
  5.   providedIn: 'root'
  6. })
  7. export class GetIvuXmlContentService {
  8.  
  9.   public xmlResponse: string;
  10.   private xmlUrl = 'assets/test_70512.xml';
  11.  
  12.   constructor(private http: HttpClient) {
  13.   }
  14.  
  15.   getXML() {
  16.  
  17.     console.log('service start');
  18.  
  19.     return this.http.get(this.xmlUrl, {observe: 'body', responseType: 'text'}).subscribe(response => {
  20.       console.log(response);
  21.       this.xmlResponse = response;
  22.     });
  23.   }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement