Advertisement
Shell_Casing

service

Dec 21st, 2018
495
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Injectable } from '@angular/core';
  2. import { HttpClient, HttpHeaders } from '@angular/common/http';
  3. import { environment } from '../environments/environment';
  4.  
  5. @Injectable({
  6.   providedIn: 'root'
  7. })
  8. export class TagsService {
  9.  
  10.   headers = new HttpHeaders({
  11.     'Authorization': `Bearer ${environment.access_token}`,
  12.   });
  13.  
  14.   private tagsUrl = environment.tagsUrl;
  15.   private dataSource = `assets/data/tags - verbose.json`;
  16.  
  17.   constructor(private http: HttpClient) { }
  18.  
  19.   // getAllTags() {
  20.   //   return this.http.get(this.tagsUrl, { headers: this.headers });
  21.   // }
  22.  
  23.   getAllTags() {
  24.     return this.http.get(this.dataSource);
  25.   }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement