Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, Input, OnInit } from "@angular/core";
- import { interval, Subscription } from "rxjs";
- import { WithSubscription } from "./with-subscription";
- @Component({
- selector: "counter",
- template: `
- <div>Count {{ count }}</div>
- `
- })
- export class CounterComponent extends WithSubscription {
- count = 0;
- ngOnInit() {
- this.subscribe(interval(1000), value => {
- this.count++;
- console.log(value);
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement