cic-staff-client/src/app/pages/tokens/token-details/token-details.component.ts
2021-03-21 14:02:18 +03:00

30 lines
801 B
TypeScript

import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core';
import {ActivatedRoute, Params} from '@angular/router';
import {TokenService} from '@app/_services';
import {first} from 'rxjs/operators';
@Component({
selector: 'app-token-details',
templateUrl: './token-details.component.html',
styleUrls: ['./token-details.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class TokenDetailsComponent implements OnInit {
token: any;
constructor(
private route: ActivatedRoute,
private tokenService: TokenService
) {
this.route.paramMap.subscribe((params: Params) => {
this.tokenService.getTokenBySymbol(params.get('id')).pipe(first()).subscribe(res => {
this.token = res;
});
});
}
ngOnInit(): void {
}
}