Pobieranie danych z pliku JSON

0

Witam

Chciałbym wyświetlać listę z pliku .json tylko nie wiem jak najlepiej i najprościej to wykonać.

Tutaj mam przykład https://github.com/ionic-team/ionic-conference-app/tree/master/src/pages/speaker-list

Zastanawiam się w jaki sposób Speaker-list wskazuje z którego pliku ma pobierać listę? Nigdzie w plikach speaker nie widać powiązania z plikiem /assets/data.json

https://github.com/ionic-team/ionic-conference-app/tree/master/src/assets/data

https://github.com/ionic-team/ionic-conference-app/blob/master/resources/screenshots/SpeakerListPage.png?raw=true

0
import { ConferenceData } from '../../providers/conference-data';

prowadzi do https://github.com/ionic-team/ionic-conference-app/blob/master/src/providers/conference-data.ts i tam jest

 load(): any {
    if (this.data) {
      return Observable.of(this.data);
    } else {
      return this.http.get('assets/data/data.json')
        .map(this.processData, this);
    }
}
0

A czy jest prostszy sposób niż w tym repozytorium na wyświetlenie w liście np. 10 pierwszych name'ów z pliku .json?


  "schedule": [{
    "date": "2047-05-17",
    "groups": [{
      "time": "8:00 am",
      "sessions": [{
        "name": "Breakfast",
        "timeStart": "8:00 am",
        "timeEnd": "9:00 am",
        "location": "Main hallway",
        "tracks": ["Food"],
        "id": "1"
      }]
    }, {
      "time": "9:15 am",
      "sessions": [{
        "name": "Introduction to Appcamp.io",
        "location": "Room 2203",
        "description": "Mobile devices and browsers are now advanced enough that developers can build native-quality mobile apps using open web technologies like HTML5, Javascript, and CSS. In this talk, we’ll provide background on why and how we created Ionic, the design decisions made as we integrated Ionic with Angular, and the performance considerations for mobile platforms that our team had to overcome. We’ll also review new and upcoming Ionic features, and talk about the hidden powers and benefits of combining mobile app development and Angular.",
        "speakerNames": ["Ellie Elephant"],
        "timeStart": "9:15 am",
        "timeEnd": "9:30 am",
        "tracks": ["Ionic"],
        "id": "2"
      }, {
        "name": "Getting started with Ionic",
        "location": "Room 2202",
        "description": "Mobile devices and browsers are now advanced enough that developers can build native-quality mobile apps using open web technologies like HTML5, Javascript, and CSS. In this talk, we’ll provide background on why and how we created Ionic, the design decisions made as we integrated Ionic with Angular, and the performance considerations for mobile platforms that our team had to overcome. We’ll also review new and upcoming Ionic features, and talk about the hidden powers and benefits of combining mobile app development and Angular.",
        "speakerNames": ["Ted Turtle"],
        "timeStart": "9:30 am",
        "timeEnd": "9:45 am",
        "tracks": ["Ionic"],
        "id": "3"
      }, {

(...)

Tak jak mamy w tym pliku to chciałbym wyświetlić w liście po kolei wartości "name" obiektów w liście.

1 użytkowników online, w tym zalogowanych: 0, gości: 1