I am encountering an issue while trying to import a class into a module in my Ionic/Angular app. Upon attempting to release, the following error message appears:
ERROR in : Unexpected directive 'SeedModalPage in /home/robson/Lunes/repositories/bolunes-app/src/app/seed-modal/seed-modal.page.ts' imported by the module 'SharedModule in /home/robson/Lunes/repositories/bolunes-app/src/app/seed-modal/shared.module.ts'. Please add a @NgModule annotation.
[ERROR] An error occurred while running subprocess ng.
The SeedModalPage is a class. Is there a way to add the @NgModule annotation to it? I attempted to do so, but it resulted in the following error:
ERROR in : directive 'SeedModalPage' is exported recursively by the module 'SeedModalPage in /home/robson/Lunes/repositories/bolunes-app/src/app/seed-modal/seed-modal.page.ts'
seed-modal-page.ts
import { Component, NgModule, OnInit } from "@angular/core";
import { NavController, ModalController } from "@ionic/angular";
import { WalletServiceService } from "../services/wallet-service.service";
import { ToastController } from "@ionic/angular";
@Component({
selector: "app-seed-modal",
templateUrl: "./seed-modal.page.html",
styleUrls: ["./seed-modal.page.scss"],
})
@NgModule({
exports: [SeedModalPage],
})
export class SeedModalPage implements OnInit {
seedWord: string;
password: string;
constructor(
private nav: NavController,
private modalCtrl: ModalController,
private wallet: WalletServiceService,
public toastController: ToastController
) {}
ngOnInit() {}
handleShowSeed() {
if (this.password === null) {
this.presentToast("Informe sua senha corretamente!");
return;
}
this.wallet
.getSeedEncrypt()
.then((resp) => {
const seed = this.wallet.descryptSeed(resp, this.password);
if (seed) {
this.seedWord = seed;
} else {
this.presentToast("erro : Senha está incorreta!");
}
})
.catch((errors) => {
this.presentToast(errors);
});
}
closeModal() {
this.modalCtrl.dismiss();
}
async presentToast(text) {
const toast = await this.toastController.create({
message: text,
duration: 2000,
});
toast.present();
}
}