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