Tapuscrit / Angular2: Fonte JSON à l'interface avec les Observables & JSONP

Je tiens à exprimer mon json-réseau pour mon interface, j'ai créé et, comme pour l'afficher dans le navigateur. Je pense qu'il y a probablement quelque chose de mal avec mon interface, mais je ne peux pas la comprendre... de Quoi ai-je besoin de changer pour obtenir mon code en cours d'exécution?

Interface:

 export interface Video {
  id: number;
  name: string;
  description: string;
  createdAt: string;
}

app.ts

import {JSONP_PROVIDERS, Jsonp} from '@angular/http';
import {Observable} from '../../../node_modules/rxjs';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/share';
import {Video} from './networking/api';

    private videoData: Observable<Video[]>;
    ngOnInit() {
                this.displayNewstVideo(10);
            }

            private displayNewstVideo(count: number) {
                this.videoData = this.jsonp
                .get('localhost:8080/video/newst/' + count + '?jsonp=JSONP_CALLBACK')
                .map(res => (res.json() as Video[]));
                alert(this.videoData.count);
            }

app.html

<div class="container">
  <div class="video" style="font-family:sans-serif" *ngFor="#entry of videoData | async;  #i = index">
      <br *ngIf="i > 0" />
      <span class="title" style="font-size:1.2rem">
        <span>{{i + 1}}. </span>
        <a href={{entry.urlDesktop}}>{{entry.name}}</a>
      </span>
      <span> ({{entry.description}})</span>
      <div>Submitted at {{entry.createdAt * 1000 | date:"mediumTime"}}.</div>
    </div>

JSON

[{
id: 1,
name: "Some Name",
description: "BlaBla",
createdAt: "2016-05-04 13:30:01.0",
},
{
id: 2,
name: "Some Name",
description: "BlaBla",
createdAt: "2016-05-04 13:30:01.0",
}]

Modifications

  1. J'ai vérifié si la demande est correct dans mon réseau-onglet dans chrome, et qu'elle fonctionne correctement: 200 OK --> Réponse ist aussi fine
  2. J'ai édité mon code que Thierry a déclaré et maintenant, il est enfin en montrant le premier objet de mon tableau :-)!! Mais j'obtiens l'erreur suivante aujourd'hui:

Uncaught EXCEPTION: Erreur dans app/html/app.html:27:11
EXCEPTION d'ORIGINE: RangeError: date Fournie n'est pas dans la plage valide.
ORIGINAL STACKTRACE:
RangeError: date Fournie n'est pas dans la plage valide.
au boundformat (native)
à une Fonction.DateFormatter.format (http://localhost:3000/node_modules/@angular/common/src/facade/intl.js:100:26)
au DatePipe.transformer (http://localhost:3000/node_modules/@angular/common/src/pipes/date_pipe.js:25:37)
à eval (http://localhost:3000/node_modules/@angular/core/src/linker/view_utils.js:188:22)
au DebugAppView._View_AppComponent1.detectChangesInternal (AppComponent.de modèle.js:377:148)
au DebugAppView.AppView.detectChanges (http://localhost:3000/node_modules/@angular/core/src/linker/view.js:200:14)
au DebugAppView.detectChanges (http://localhost:3000/node_modules/@angular/core/src/linker/view.js:289:44)
au DebugAppView.AppView.detectContentChildrenChanges (http://localhost:3000/node_modules/@angular/core/src/linker/view.js:215:37)
au DebugAppView._View_AppComponent0.detectChangesInternal (AppComponent.de modèle.js:198:8)
au DebugAppView.AppView.detectChanges (http://localhost:3000/node_modules/@angular/core/src/linker/view.js:200:14)
ERREUR DE CONTEXTE:
[object object]

OriginalL'auteur safari | 2016-05-13