This file contains 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
<mat-toolbar color="primary"> | |
<span>Blog List</span> | |
</mat-toolbar> | |
<div class="page-wrapper"> | |
<div fxLayout="row wrap" fxLayoutGap="16px"> | |
<mat-card fxFlex="calc(33% - 16px)" *ngFor="let post of posts$ | async"> | |
<mat-card-header> | |
<mat-card-title>{{ post.title.rendered }}</mat-card-title> | |
<mat-card-subtitle>{{ post.date_gmt | date }}</mat-card-subtitle> | |
</mat-card-header> |
This file contains 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 } from '@angular/core'; | |
import { Observable } from 'rxjs'; | |
import { WordpressService } from './wordpress.service'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.scss'] | |
}) |
This file contains 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 { Injectable } from '@angular/core'; | |
import { HttpClient } from '@angular/common/http'; | |
import { Observable } from 'rxjs'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class WordpressService { | |
constructor(private http: HttpClient) { } |
This file contains 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 { NgModule } from '@angular/core'; | |
import { MatToolbarModule, MatCardModule, MatButtonModule } from '@angular/material'; | |
const materialModules = [ | |
MatToolbarModule, | |
MatCardModule, | |
MatButtonModule, | |
]; | |
@NgModule({ |