Skip to content

Commit

Permalink
change to spread operator
Browse files Browse the repository at this point in the history
  • Loading branch information
unseen1980 committed Sep 26, 2016
1 parent 9d7013e commit eb44b99
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/app/news/news.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ export class NewsComponent implements OnInit {
this._newsApiService.fetchArticles(agent)
.subscribe(
(res) => {
for (let article in res['articles']) {
this.articles.push(res['articles'][article]);
}
this.articles.push(...res['articles']);
},
error => console.log('Error!')
);
Expand Down

0 comments on commit eb44b99

Please sign in to comment.