Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {Injectable} from '@angular/core';
- import {HttpClient} from '@angular/common/http';
- @Injectable({
- providedIn: 'root'
- })
- export class GetIvuXmlContentService {
- public xmlResponse: string;
- private xmlUrl = 'assets/test_70512.xml';
- constructor(private http: HttpClient) {
- }
- getXML() {
- console.log('service start');
- return this.http.get(this.xmlUrl, {observe: 'body', responseType: 'text'}).subscribe(response => {
- console.log(response);
- this.xmlResponse = response;
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement