|
|
@ -22,15 +22,18 @@ export class FeedComponent implements OnInit {
|
|
|
|
ngOnInit() {
|
|
|
|
ngOnInit() {
|
|
|
|
this.feedService.getAllPostsRaw().subscribe(response => {
|
|
|
|
this.feedService.getAllPostsRaw().subscribe(response => {
|
|
|
|
this.feedNew = this.feedService.renderAllPosts(response.json())
|
|
|
|
this.feedNew = this.feedService.renderAllPosts(response.json())
|
|
|
|
console.log(response)
|
|
|
|
|
|
|
|
this.parentSelectedPostList = this.feedNew
|
|
|
|
this.parentSelectedPostList = this.feedNew
|
|
|
|
this.feedMostLiked = this.feedNew
|
|
|
|
this.feedMostLiked = this.feedNew
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
createPost(pContent: string){
|
|
|
|
createPost(pElement){
|
|
|
|
this.feedService.createPost(pContent)
|
|
|
|
this.feedService.createPost(pElement.value)
|
|
|
|
console.log(pContent)
|
|
|
|
pElement.value = ""
|
|
|
|
|
|
|
|
this.feedService.getAllPostsRaw().subscribe(response => {
|
|
|
|
|
|
|
|
this.feedNew = this.feedService.renderAllPosts(response.json())
|
|
|
|
|
|
|
|
this.parentSelectedPostList = this.feedNew
|
|
|
|
|
|
|
|
this.feedMostLiked = this.feedNew})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
showNew() {
|
|
|
|
showNew() {
|
|
|
|