ucap-lg-web/src/app/pages/group/components/index.page.component.ts
Park Byung Eun 23bbfc4b63 0524 sync
2020-05-24 13:46:38 +09:00

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();
}
}
}