所以在Angular Nativesript环境中这个持续存在的问题,我只在auth.module.tns.ts文件中声明了组件。
Error: Type LoginComponent is part of the declarations of 2 modules: AuthModule and AuthModule! Please consider moving LoginComponent to a higher module that imports AuthModule and AuthModule. You can also create a new NgModule that exports and includes LoginComponent then import that NgModule in AuthModule and AuthModule.
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {AuthRoutingModule} from '../../views/auth/auth-routing.module';
@NgModule({
declarations: [],
imports: [
CommonModule,
AuthRoutingModule
]
})
export class AuthModule {
}
import {NgModule, NO_ERRORS_SCHEMA} from '@angular/core';
import {NativeScriptCommonModule} from 'nativescript-angular/common';
import {AuthRoutingModule} from '../../views/auth/auth-routing.module';
import {LoginComponent} from '@src/app/views/auth/login/login.component';
import {SignupComponent} from '@src/app/views/auth/signup/signup.component';
@NgModule({
declarations: [
LoginComponent,
SignupComponent
],
imports: [
AuthRoutingModule,
NativeScriptCommonModule,
],
exports: [],
schemas: [NO_ERRORS_SCHEMA]
})
export class AuthModule {
}
关于原因可能有什么建议?