Created
October 21, 2020 09:40
-
-
Save mkubdev/94c46a46524f59a5e6af6352b91ac1cb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import { Component, OnInit } from '@angular/core'; | |
| import { PostService } from 'services/post.service'; | |
| @Component({ | |
| selector: 'app-post', | |
| templateUrl: './post.component.html', | |
| styleUrls: ['./post.component.scss'] | |
| }) | |
| export class PostComponent implements OnInit { | |
| posts: any = []; | |
| constructor(private postSvc: PostService) { } | |
| ngOnInit() { | |
| this.postSvc.getAllPosts().subscribe(res => { | |
| console.log("posts", res); | |
| this.posts = res; | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment