Skip to content
Snippets Groups Projects
Commit 48c841b4 authored by Administrator's avatar Administrator
Browse files

list datastets ok

parent 70ac9382
No related branches found
No related tags found
No related merge requests found
......@@ -6,5 +6,10 @@
<button type="submit" (click)="listdatasets()" class="btn btn-primary">List datasets</button>
</div>
<p><strong>{{dataresult}}</strong></p>
<p><strong>Datasets examples: </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>
</form>
......@@ -11,8 +11,8 @@ import { Observable } from 'rxjs';
styleUrls: ['./datasets.component.scss']
})
export class DatasetsComponent implements OnInit {
result: Promise<any>;
dataresult: any;
itemsdatasets: any;
constructor(
private appConfig: AppConfiguration,
......@@ -33,15 +33,15 @@ export class DatasetsComponent implements OnInit {
var myInit = { method: 'GET', headers: myHeaders};
var myRequest = new Request('https://data.inra.fr/api/search?q=*&type=dataset',myInit);
var myRequest = new Request('https://data.inra.fr/api/search?q=*&type=dataset&start=60000&show_entity_ids=true',myInit);
fetch(myRequest, myInit)
.then(response => {
response.json()
.then(data => {
this.dataresult = 'Total des datasets trouvés: ' + JSON.stringify(data['data']['total_count']);
;
// console.log(this.dataresult);
this.itemsdatasets = data['data']['items'];
console.log(this.itemsdatasets);
});
});
......
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