Last active
January 2, 2019 14:11
-
-
Save splincode/b9c798f05937e55c0528dff1be7fd3c6 to your computer and use it in GitHub Desktop.
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
@Component({ | |
selector: 'app-root', | |
template: ` | |
<ng-container *ngIf="counter$ | async as counter"> | |
<h1>{{ counter }}</h1> | |
</ng-container> | |
| |
<button (click)="increment()">Increment</button> | |
` | |
}) | |
export class AppComponent { | |
@Select(CounterState) | |
public counter$: Observable<number>; | |
| |
@Dispatch() | |
public increment = () => new Increment() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment