Skip to content

Commit

Permalink
show post content
Browse files Browse the repository at this point in the history
  • Loading branch information
dvorad committed Jun 19, 2017
1 parent ddcdb3e commit 30982dd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions server/controllers/post.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function get(req, res) {
}

function create(params) {
console.log('===================', params);
const post = new Post({
title: params.data.title,
content: params.data.content
Expand Down
1 change: 1 addition & 0 deletions src/app/graphql/Users.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ query Posts {
posts {
id
title
content
}
}
2 changes: 1 addition & 1 deletion src/app/posts/posts.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h2>Posts list</h2>
<!--<img md-list-avatar src="..." alt="Desc 1">-->
<a md-line [routerLink]="['/post', post.id]"> {{post.title}} </a>
<p md-line>
<span>An awesome description....</span>
<span>{{post.content}}</span>
</p>
<span><button md-button (click)='deletePost(post.id)'><md-icon>delete</md-icon></button></span>
<span><button md-button (click)='editPost(post.id)'><md-icon>edit</md-icon></button></span>
Expand Down
4 changes: 3 additions & 1 deletion src/app/posts/posts.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ export class PostsComponent implements OnInit {
this.nameControl.valueChanges.debounceTime(300).subscribe(name => {
this.nameFilter.next(name);
});
console.log('all posts');
console.log(this.posts);


}

Expand All @@ -57,7 +60,6 @@ export class PostsComponent implements OnInit {
// this.nameFilter.next(null);
// }


public addNewPost(){
//open modal or something else...
//meantime go to posts/new.
Expand Down

0 comments on commit 30982dd

Please sign in to comment.