Created
September 18, 2017 17:41
-
-
Save philipszdavido/2c697b5b4a6b2f83c600dcf550759138 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//src/app/app.component.ts | |
article: Observable<Article[]> | |
constructor(private store: Store<fromArticle.State>){ | |
this.article = this.store.select(fromArticle.getArticles).subscribe((v: Array<Article>) => { | |
this.article = v.sort((a: Article, b: Article) => { | |
return b.points - a.points | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment