How to subscribe to an event on a service in Angular2?

前端 未结 2 2037
情歌与酒
情歌与酒 2020-11-28 02:27

I know how to raise an event with the EventEmitter. I can also attach a method to be called if I have a component like this:



        
2条回答
  •  萌比男神i
    2020-11-28 02:38

    Using alpha 28, I accomplished programmatically subscribing to event emitters by way of the eventEmitter.toRx().subscribe(..) method. As it is not intuitive, it may perhaps change in a future release.

提交回复
热议问题