import { Component, OnInit } from '@angular/core'; import { TokenService } from 'src/app/common/services/token.service'; import { forkJoin } from 'rxjs'; @Component({ selector: 'app-goals', templateUrl: './goals.component.html', styleUrls: ['./goals.component.css'] }) export class GoalsComponent implements OnInit { constructor(private tokenService: TokenService) { forkJoin(this.tokenService.getToken()).subscribe(t => { localStorage.setItem('token', t[0].token_type + ' ' + t[0].access_token); }); } ngOnInit(): void { } }