I'm trying an experiment with Observables and Angular2. I created a simple
timer observable and tried to display it in a component and it doesn't seem
to be updating after the initial page load. If I throw in a button and
click it, it will cause it to update on each click. Is there some
additional step I need to get this to update the page on each timer event?
const domain$ = Rx.Observable.timer(0, 1000).startWith(0);
@Component({
selector: 'main-app',
template: `
<h1>Timer</h1>
<span>{{count|async}}</span><br/>
`
})
export class MainComponent {
constructor() {
this.count = domain$.map(i => `Seconds elapsed ${i}`);
}
}
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.