如何在Angular 2中将HTTP_PROVIDERS添加到UpgradeProvider引导程序? [英] How to add HTTP_PROVIDERS to an UpgradeProvider bootstrap in Angular 2?
本文介绍了如何在Angular 2中将HTTP_PROVIDERS添加到UpgradeProvider引导程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用:
let adapter: UpgradeAdapter = new UpgradeAdapter();
[...]
adapter.bootstrap(document.body, ["app"]);
引导我的Angular应用程序.现在,我需要为此添加HTTP_PROVIDERS.我尝试了许多变体,但没有一个起作用,
To bootstap my Angular application. Now I need to add HTTP_PROVIDERS to this. I have tried many variations but none did work including:
adapter.bootstrap(document.body, ["app", HTTP_PROVIDERS]);
adapter.bootstrap(document.body, ["app", [HTTP_PROVIDERS]]);
有人知道正确的方法吗?
Does anyone know the correct way?
推荐答案
您可以尝试
adapter.addProvider(HTTP_PROVIDERS);
这篇关于如何在Angular 2中将HTTP_PROVIDERS添加到UpgradeProvider引导程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文