Skip to content

Instantly share code, notes, and snippets.

@langan
Created May 29, 2018 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save langan/2a6191682ac6c93275ff2142e3afab58 to your computer and use it in GitHub Desktop.
Save langan/2a6191682ac6c93275ff2142e3afab58 to your computer and use it in GitHub Desktop.
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']
})
export class AppComponent {
posts$: Observable<any[]>;
constructor(private wp: WordpressService) {
this.posts$ = this.wp.getPosts();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment