Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ionic framework http客户端Ionic 3没有提供程序错误_Ionic Framework - Fatal编程技术网

Ionic framework http客户端Ionic 3没有提供程序错误

Ionic framework http客户端Ionic 3没有提供程序错误,ionic-framework,Ionic Framework,我已经试着解决这个问题好几个小时了。我的ionic应用程序在运行时不断出现此错误“http客户端没有提供程序”。我添加了一个HttpModule,并将其包含在我的app.module.ts的导入中,但仍然会出现这个可怕的错误。 从'@angular/core'导入{NgModule,ErrorHandler}; 从“@angular/platform browser”导入{BrowserModule}; 从“离子角度”导入{IonicApp,IonicModule,IonicErrorHa

我已经试着解决这个问题好几个小时了。我的ionic应用程序在运行时不断出现此错误“http客户端没有提供程序”。我添加了一个HttpModule,并将其包含在我的app.module.ts的导入中,但仍然会出现这个可怕的错误。

从'@angular/core'导入{NgModule,ErrorHandler};
从“@angular/platform browser”导入{BrowserModule};
从“离子角度”导入{IonicApp,IonicModule,IonicErrorHandler};
从“./app.component”导入{MyApp};
从'@angular/http'导入{HttpModule};
从“../pages/about/about”导入{AboutPage};
从“../pages/contact/contact”导入{ContactPage};
从“../pages/home/home”导入{HomePage};
从“../pages/tabs/tabs”导入{TabsPage};
从“../pages/settings/settings”导入{SettingsPage};
从'@ionic native/status bar'导入{StatusBar};
从'@ionic native/SplashScreen'导入{SplashScreen};
从“../providers/weather/weather”导入{WeatherProvider};
@NGD模块({
声明:[
MyApp,
约页,
联系页面,
主页
塔布斯帕奇,
设置间距
],
进口:[
浏览器模块,
HttpModule,
IonicModule.forRoot(MyApp),
],
引导:[IonicApp],
入口组件:[
MyApp,
约页,
联系页面,
主页
塔布斯帕奇,
设置间距
],
供应商:[
HttpModule,
状态栏,
飞溅屏幕,
{提供:ErrorHandler,useClass:IonicerHandler},
天气预报员
]
})

导出类AppModule{}
实际上发现我包含了“httpModule”而不是“httpClient”

我通过在代码中替换它来修复它

从'@angular/core'导入{NgModule,ErrorHandler};
从“@angular/platform browser”导入{BrowserModule};
从“离子角度”导入{IonicApp,IonicModule,IonicErrorHandler};
从“./app.component”导入{MyApp};
从'@angular/http'导入{HttpModule};
从'@angular/common/http'导入{HttpClient};
从“../pages/about/about”导入{AboutPage};
从“../pages/contact/contact”导入{ContactPage};
从“../pages/home/home”导入{HomePage};
从“../pages/tabs/tabs”导入{TabsPage};
从“../pages/settings/settings”导入{SettingsPage};
从'@ionic native/status bar'导入{StatusBar};
从'@ionic native/SplashScreen'导入{SplashScreen};
从“../providers/weather/weather”导入{WeatherProvider};
@NGD模块({
声明:[
MyApp,
约页,
联系页面,
主页
塔布斯帕奇,
设置间距
],
进口:[
浏览器模块,
HttpClient,
HttpModule,
IonicModule.forRoot(MyApp),
],
引导:[IonicApp],
入口组件:[
MyApp,
约页,
联系页面,
主页
塔布斯帕奇,
设置间距
],
供应商:[
状态栏,
飞溅屏幕,
{提供:ErrorHandler,useClass:IonicerHandler},
天气预报员
]
})
导出类AppModule{}