如何在Angular中使用subscribe next RxJS?

如何在Angular中使用subscribe next RxJS?,angular,rxjs,observable,next,subscribe,Angular,Rxjs,Observable,Next,Subscribe,我正在学习rxjs。我有一个可以从阵列中观察到的。我想在函数中加入一些水果,使用subscribe和next。我写得不对,我能帮你吗。非常感谢你 const fruits = from([ "apple", "banana", "cherry"]); fruits.subscribe(fruit => this.next(fruit)); 你的练习答案:D fruits.subscribe(fruit => toConveyorBelt(fruit));

我正在学习rxjs。我有一个可以从阵列中观察到的。我想在函数中加入一些水果,使用subscribe和next。我写得不对,我能帮你吗。非常感谢你

const fruits = from([
    "apple",
    "banana",
    "cherry"]);

fruits.subscribe(fruit => this.next(fruit));
你的练习答案:D

fruits.subscribe(fruit => toConveyorBelt(fruit));

非常感谢。我想完成这节课:但我不知道这节课是什么?你能给我解释一下吗?再次感谢大家!!!如果答案适合你,我建议你投票/接受它。:)@江江,请投票表决答案。我已经在上面的课程中添加了解决方案。
fruits.subscribe(fruit => toConveyorBelt(fruit));