You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
911 B
TypeScript
39 lines
911 B
TypeScript
import {Component, OnDestroy, OnInit} from "@angular/core";
|
|
import {ActivatedRoute} from "@angular/router";
|
|
import {Title} from "@angular/platform-browser";
|
|
import {Subscription} from "rxjs";
|
|
|
|
@Component({
|
|
selector: 'mining',
|
|
template: `
|
|
<div page-content>
|
|
<div inner>
|
|
<div class="mining">
|
|
<router-outlet></router-outlet>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`
|
|
})
|
|
export class MiningComponent implements OnInit, OnDestroy{
|
|
private subs: any[] = [];
|
|
|
|
constructor(private title: Title,
|
|
private route: ActivatedRoute) {
|
|
}
|
|
|
|
ngOnInit() {
|
|
this.subs.push(this.route.params.subscribe(params => {
|
|
this.title.setTitle(params['community'].toUpperCase() + ' | Mining');
|
|
}));
|
|
}
|
|
|
|
ngOnDestroy() {
|
|
this.subs.forEach(subscription => {
|
|
if(subscription instanceof Subscription) {
|
|
subscription.unsubscribe();
|
|
}
|
|
});
|
|
}
|
|
}
|