Skip to content

Commit 83a64e9

Browse files
fix question 19 example issue
1 parent f32ff43 commit 83a64e9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -735,9 +735,14 @@ You can download the PDF and Epub version of this repository from the latest run
735735
Time: {{ time | async }}</div>`
736736
})
737737
export class AsyncObservablePipeComponent {
738-
time = new Observable(observer =>
739-
setInterval(() => observer.next(new Date().toString()), 2000)
740-
);
738+
time: Observable<string>;
739+
constructor() {
740+
this.time = new Observable((observer) => {
741+
setInterval(() => {
742+
observer.next(new Date().toString());
743+
}, 2000);
744+
});
745+
}
741746
}
742747
```
743748

0 commit comments

Comments
 (0)