Skip to content

Commit ce04905

Browse files
authored
Merge pull request #57 from VasileDurlesteanu/master
fix question 19 example issue
2 parents b076b66 + 83a64e9 commit ce04905

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)