Skip to content

Instantly share code, notes, and snippets.

@considine
Created October 9, 2018 08:44
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 considine/6010dae4f709408501ec235e83653061 to your computer and use it in GitHub Desktop.
Save considine/6010dae4f709408501ec235e83653061 to your computer and use it in GitHub Desktop.
import { Observable } from "rxjs";
import { PostsService } from "./../posts.service";
import { Component, OnInit } from "@angular/core";
@Component({
selector: "app-list",
templateUrl: "categories.page.html",
styleUrls: ["categories.page.scss"]
})
export class CategoriesPage implements OnInit {
public categories$: Observable<any>;
public items: Array<{ title: string; note: string; icon: string }> = [];
constructor(private postSrvc: PostsService) {}
ngOnInit() {
this.categories$ = this.postSrvc.fetchPostCategories();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment