41 lines
1.0 KiB
TypeScript
41 lines
1.0 KiB
TypeScript
import { Subscription } from 'rxjs';
|
|
|
|
import { Component, OnInit, OnDestroy } from '@angular/core';
|
|
import { Router, ActivatedRoute, Params } from '@angular/router';
|
|
|
|
import { LogService } from '@ucap/ng-logger';
|
|
|
|
import { QueryParams } from '../types/params.type';
|
|
|
|
@Component({
|
|
selector: 'app-pages-group-index',
|
|
templateUrl: './index.page.component.html',
|
|
styleUrls: ['./index.page.component.scss']
|
|
})
|
|
export class IndexPageComponent implements OnInit, OnDestroy {
|
|
private paramsSubscription: Subscription;
|
|
|
|
constructor(
|
|
private activatedRoute: ActivatedRoute,
|
|
private router: Router,
|
|
private logService: LogService
|
|
) {}
|
|
|
|
userSeq: string;
|
|
|
|
ngOnInit(): void {
|
|
this.paramsSubscription = this.activatedRoute.queryParams.subscribe(
|
|
(params: Params) => {
|
|
const seqParam = params[QueryParams.ID];
|
|
this.userSeq = !!seqParam ? seqParam : undefined;
|
|
}
|
|
);
|
|
}
|
|
|
|
ngOnDestroy(): void {
|
|
if (!!this.paramsSubscription) {
|
|
this.paramsSubscription.unsubscribe();
|
|
}
|
|
}
|
|
}
|