共享服务在角度2中提供承诺错误

时间:2018-04-21 05:34:13

标签: angular2-routing angular2-template angular2-forms angular2-services angular2-directives

在角度2中使用共享服务时出错。

我刚刚添加到提供程序中并试图注入另一个组件给我提问。

你可以帮帮我吗? 感谢。

enter image description here enter image description here

1 个答案:

答案 0 :(得分:0)

整个应用程序中只有一个组件可以引导。您正在尝试引导服务。在提供程序中添加服务。然后它会正常工作。