我试图在本地脚本应用中启动并运行HTTP。
我的模块bootstrapping看起来像这样:
// this import should be first in order to load some required settings (like globals and reflect-metadata)
import { platformNativeScriptDynamic, NativeScriptModule } from "nativescript-angular/platform";
import { NgModule } from "@angular/core";
import {MainPage, ListTest, ItemComponent} from "./main-page";
import {HttpModule} from '@angular/http';
import {NativeScriptHttpModule} from 'nativescript-angular/http';
@NgModule({
declarations: [MainPage, ListTest,ItemComponent],
bootstrap: [MainPage],
imports: [NativeScriptModule,NativeScriptHttpModule]
})
class AppComponentModule { }
platformNativeScriptDynamic().bootstrapModule(AppComponentModule, NativeScriptHttpModule);
当我启动应用程序时,我得到以下运行时异常:
我收到以下错误n ./MainPage class MainPage_Host - inline template:0:0 caused by: No provider for NSHttp!
有什么想法吗?