Website/src/app/website/news-page/news-page.component.ts
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-news-page',
templateUrl: './news-page.component.html',
styleUrls: ['./news-page.component.scss']
})
export class NewsPageComponent implements OnInit {
year: number;
constructor(
private route: ActivatedRoute
) {
}
ngOnInit(): void {
this.route.params.subscribe(({year}) => {
this.year = year;
});
}
}