Wrap it in a template that prevents the ngFor from being executed until the
member has a value:
<template [ngIf]="spiele">
    <div *ngFor=...



On Sat, Jun 11, 2016 at 9:10 AM, TiDiDoDa <[email protected]> wrote:

> Hi,
>
> i've got a problem: i'm getting some data with http and want to display
> them on my view. But i always get the error "Uncaught EXCEPTION: Error in
> build/pages/kalender/kalender.html:11:32
> ORIGINAL EXCEPTION: TypeError: Cannot read property 'date' of undefined
> ORIGINAL STACKTRACE:
> TypeError: Cannot read property 'date' of undefined" and my application
> crashes (i can not navigate, ...)
> Here my http part:
>
>> this.http.get("url...")
>>     .retry(3)
>>     .subscribe(
>>         response => this.spiele = response.json()
>>     );
>>
>>
> And the html part:
>
>> <div *ngFor="let s of spiele" *ngIf="spiele">
>
>     {{ s.date }}
>
> </div>
>
>
> How can i wait till http request is finished?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Lucas Lacroix
Computer Scientist
System Technology Division, MEDITECH <http://ehr.meditech.com>
781-774-2293

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to