Skip to content
Snippets Groups Projects
Commit 55030dce authored by Administrator's avatar Administrator
Browse files

list datastets ok

parent 48c841b4
No related branches found
No related tags found
No related merge requests found
<h3>Here list of datasets directly from the openapi GET</h3>
<h3>where you can choose what to publish in FDP</h3>
<h3>Here list of datasets directly from the repository api </h3>
<form>
<div>
<button type="submit" (click)="listdatasets()" class="btn btn-primary">List datasets</button>
</div>
<p><strong>{{dataresult}}</strong></p>
<p><strong>Datasets examples: </strong></p>
<p><strong>Total datasets found: {{dataresult}}</strong></p>
<p><strong>Examples of datasets found: </strong></p>
<ul>
<li *ngFor="let item of itemsdatasets; let i = index"><a href={{item.url}} target="_blank" >{{item.entity_id}} {{item.name}} </a> <br> {{item.description}}</li>
</ul>
......
......@@ -2,14 +2,15 @@ import { Component, OnInit } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { AppConfiguration } from '../AppConfiguration';
import { FileSaverService } from 'ngx-filesaver';
import { resolve } from 'url';
import { Observable } from 'rxjs';
@Component({
selector: 'app-datasets',
templateUrl: './datasets.component.html',
styleUrls: ['./datasets.component.scss']
})
export class DatasetsComponent implements OnInit {
dataresult: any;
itemsdatasets: any;
......@@ -24,10 +25,7 @@ export class DatasetsComponent implements OnInit {
}
listdatasets() {
var myHeaders = new Headers();
myHeaders.append("Content-Type", "Application/json");
......@@ -39,18 +37,12 @@ export class DatasetsComponent implements OnInit {
.then(response => {
response.json()
.then(data => {
this.dataresult = 'Total des datasets trouvés: ' + JSON.stringify(data['data']['total_count']);
this.itemsdatasets = data['data']['items'];
console.log(this.itemsdatasets);
});
});
this.dataresult =JSON.stringify(data['data']['total_count']);
this.itemsdatasets = data['data']['items'];
});
});
return null;
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment