Created
June 16, 2019 13:29
-
-
Save wescopeland/4306735b36a987b7191ab06463d0150d to your computer and use it in GitHub Desktop.
stateful.component.ts
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 { 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