简体   繁体   中英

ionic 5 services declared but return emod property error

I am trying to create a service in ionic5 and use it in a specific page so I imported it in app.module.ts as well as page.module.ts files

The problem I am facing is

core.js:6498 ERROR Error: Uncaught (in promise): Error: Type MiscService does not have 'ɵmod' property. Error: Type MiscService does not have 'ɵmod' property. at getNgModuleDef (core.js:1131)

this is my page module

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { HomePage } from './home.page';

import { HomePageRoutingModule } from './home-routing.module';
import { TranslateModule } from '@ngx-translate/core';
import { MiscService } from '../../providers/misc.service';

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    IonicModule,
    HomePageRoutingModule,
    TranslateModule,
    MiscService
    ],
  declarations: [HomePage],
  exports:[TranslateModule]
})
export class HomePageModule { }

The problem is that while importing native plugins I missed out /ngx in my miscservice.ts file, for ionic5 it is been added up.

import { FileTransfer } from '@ionic-native/file-transfer/ngx'; import { File } from '@ionic-native/file/ngx'; import { FileOpener } from '@ionic-native/file-opener/ngx';

Thank you for all your support

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM