Skip to content

Feeds not Displaying  #9

Open
Open
@junaid-khurshid

Description

@junaid-khurshid

I am using Angular 4 and tried to do all the thing that you taught in Tutorials.
first i tried to call from the selector of FeedcardComponent.. no data fetched from their.. i have done to check data is coming from Service that's y Console.log is done but empty array is fetched... Plz look into Code and Mention my Mistakes

Dashboard Component :

export class DashboardsComponent implements OnInit {

private feedUrl :  string = 'https%3A%2F%2Fwww.becompany.ch%2Fen%2Fblog%2Ffeed.xml'
feeds: Array<FeedEntry> = [];

constructor (
private feedService :FeedService
) {}

ngOnInit() {
this.refreshFeed();
}

refreshFeed() {
this.feeds.length = 0;
// Adds 1s of delay to provide user's feedback.
this.feedService.getFeedContent(this.feedUrl).delay(1000)

    .subscribe(
        feed => this.feeds = feed.items,
        
        error => console.log(error));
        console.log(this.feeds);
      }
}  

Dashboard HTML :

       <div class="at-show-elms-on-hover at-p-15"  *ngFor="let feed of feeds"  >
                                <div fxLayout="column">
                                        <h4 class="at-mb-5 at-tw-400">{{feed.title}}</h4>
                                        <small md-line class="mat-fg-grey" fxLayoutAlign="start center">
                                            <md-icon class="at-mr-5">event</md-icon>
                                            <span>{{feed.description}}</span>
                                        </small> 
                                      </div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions