Very new to Angular so this is probably a setup issue. But I have a module that is undefined when I try and import it into another module and I think it has to do with the order because when I switch it the other module can't be imported.
My tree looks like this
|-- src/
| |-- app/
| | |-- components/
| | | |-- login/
| | | | |-- login.compact.component.html
| | | | |-- login.component.html
| | | | |-- login.component.ts
| | | | |-- login.service.ts
| | | | |-- login.module.ts
| | | |-- ...
| | | |-- components.module.ts
| | |-- shared/
| | | |-- header/
| | | |-- footer/
| | | |-- navigation/
| | | |-- shared.module.ts
| | |-- app.component.html
| | |-- app.component.ts
| | |-- app.module.ts
| | |-- app.routes.ts
I was trying to add a compact version of login to my navigation bar
navigation.component.html
<nav>
....
<mylogin></mylogin>
</nav>
But when I add the LoginModule to the imports of the SharedModule I get this errror Unexpected value 'undefined' imported by the module 'LoginModule'
In my app.module.ts I have
import {SharedModule} from './shared/shared.module';
import {ComponentsModule} from './components/components.module';
....
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
FormsModule,
HttpClientModule,
SharedModule,
ComponentsModule,
BsDropdownModule.forRoot(),
RouterModule.forRoot(
APP_ROUTES,
{enableTracing: true})
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {
}
Is this a bad way to structure the app? Or is it wrong to try and import login into the shared module to use in navigation?