|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
|
|
|
|
import { Post } from 'src/app/models/post';
|
|
|
|
|
import { FeedService } from 'src/app/services/feed/feed.service';
|
|
|
|
|
import { Router } from '@angular/router';
|
|
|
|
|
import { User } from 'src/app/models/user';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'feed-postlist',
|
|
|
|
@ -13,7 +15,7 @@ export class PostlistComponent implements OnInit {
|
|
|
|
|
@Output() voteEvent = new EventEmitter<boolean>();
|
|
|
|
|
selectedPost: Post;
|
|
|
|
|
|
|
|
|
|
constructor(private feedService: FeedService) { }
|
|
|
|
|
constructor(private feedService: FeedService, private router: Router) { }
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
}
|
|
|
|
@ -28,4 +30,7 @@ export class PostlistComponent implements OnInit {
|
|
|
|
|
this.voteEvent.emit(true); });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public showUserProfile(post: any) {
|
|
|
|
|
this.router.navigate(['profile/' + post.author.id]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|