2021-03-14 09:23:20 +01:00
|
|
|
import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core';
|
2020-11-25 09:00:20 +01:00
|
|
|
import {ActivatedRoute, Params} from '@angular/router';
|
2021-02-17 13:49:04 +01:00
|
|
|
import {TokenService} from '@app/_services';
|
2020-12-05 07:30:30 +01:00
|
|
|
import {first} from 'rxjs/operators';
|
2020-11-25 09:00:20 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-token-details',
|
|
|
|
templateUrl: './token-details.component.html',
|
2021-03-14 09:23:20 +01:00
|
|
|
styleUrls: ['./token-details.component.scss'],
|
|
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
2020-11-25 09:00:20 +01:00
|
|
|
})
|
|
|
|
export class TokenDetailsComponent implements OnInit {
|
|
|
|
token: any;
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
private route: ActivatedRoute,
|
|
|
|
private tokenService: TokenService
|
|
|
|
) {
|
|
|
|
this.route.paramMap.subscribe((params: Params) => {
|
2021-03-14 09:23:20 +01:00
|
|
|
this.tokenService.getTokenBySymbol(params.get('id')).pipe(first()).subscribe(res => {
|
|
|
|
this.token = res.body;
|
2020-12-05 07:30:30 +01:00
|
|
|
});
|
2020-11-25 09:00:20 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|