Skip to content

Instantly share code, notes, and snippets.

@wescopeland
Created June 16, 2019 13:29
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 wescopeland/4306735b36a987b7191ab06463d0150d to your computer and use it in GitHub Desktop.
Save wescopeland/4306735b36a987b7191ab06463d0150d to your computer and use it in GitHub Desktop.
stateful.component.ts
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { AwesomeEntity, AwesomeEntitiesQuery } from './+state';
@Component({
selector: 'app-stateful-component',
template: /* html */ `
<app-presentational-button></app-presentational-button>
`
})
export class StatefulComponent implements OnInit {
public awesomeEntities$: Observable<AwesomeEntity[]>;
constructor(private _query: AwesomeEntitiesQuery) {}
ngOnInit() {
this.awesomeEntities$ = this._query.selectAll();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment