Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feeds not Displaying #9

Open
junaid-khurshid opened this issue Feb 1, 2018 · 0 comments
Open

Feeds not Displaying #9

junaid-khurshid opened this issue Feb 1, 2018 · 0 comments

Comments

@junaid-khurshid
Copy link

junaid-khurshid commented Feb 1, 2018

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant