我正在尝试从中实现ion2-calendar https://github.com/hsuanxyz/ion2-calendar
但是当我尝试导入到我的app.module.ts
我收到此错误:
Uncaught Error: Cannot find module "@ionic/angular"
at webpackMissingModule (calendar.modal.js:13)
at Object.<anonymous> (calendar.modal.js:13)
at __webpack_require__ (bootstrap ff18038c92faa82fd673:54)
at Object.<anonymous> (index.js:7)
at __webpack_require__ (bootstrap ff18038c92faa82fd673:54)
at Object.355 (main.ts:5)
at __webpack_require__ (bootstrap ff18038c92faa82fd673:54)
at Object.332 (main.ts:1)
at __webpack_require__ (bootstrap ff18038c92faa82fd673:54)
at webpackJsonpCallback (bootstrap ff18038c92faa82fd673:25)
我的app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { Http, Headers, RequestOptions, HttpModule } from '@angular/http';
import { CalendarModule } from 'ion2-calendar';
@NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
BrowserModule,HttpModule,
IonicModule.forRoot(MyApp),
CalendarModule
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}
不知道怎么了
答案 0 :(得分:2)
好像您已经下载了库的ionic 4版本。尝试使用https://github.com/HsuanXyz/ion2-calendar/tree/v2,此版本是为ionic-angular
而非@ionic/angular
设置的,看起来像您的版本。希望这会有所帮助:)