30 lines
801 B
TypeScript
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 {
|
|
}
|
|
|
|
}
|