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.
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import {HttpClient} from "@angular/common/http";
|
|
import {Component, OnDestroy, OnInit} from "@angular/core";
|
|
import {Subscription} from "rxjs";
|
|
|
|
import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component";
|
|
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
|
|
import {properties} from "src/environments/environment";
|
|
|
|
@Component({
|
|
selector: 'fos',
|
|
templateUrl: 'fos.component.html',
|
|
styleUrls: ['fos.component.css']
|
|
})
|
|
export class FosComponent implements OnInit, OnDestroy {
|
|
|
|
public fos: any = [];
|
|
public index: number = 0;
|
|
|
|
properties: EnvProperties = properties;
|
|
public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'FOS'}];
|
|
|
|
subscriptions: Subscription[] = [];
|
|
|
|
constructor(
|
|
private httpClient: HttpClient
|
|
) {}
|
|
|
|
ngOnInit() {
|
|
this.httpClient.get('/assets/vocabulary/fos.json').subscribe(data => {
|
|
this.fos = data['fos'];
|
|
});
|
|
}
|
|
|
|
public ngOnDestroy() {
|
|
for (let sub of this.subscriptions) {
|
|
sub.unsubscribe();
|
|
}
|
|
}
|
|
|
|
changeDisplayedFos(i) {
|
|
this.index = i;
|
|
// console.log(this.fos[this.index]);
|
|
}
|
|
} |