I'm trying to use another component from another module, but its not working in my router-outlet.
app.module
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { MainModule } from './main/main.module';
import { AppComponent } from './app/app.component';
import { KeypadComponent } from './keypad/keypad.component;
import { routing } from './app.routing';
@NgModule({
declarations: [
AppComponent,
MainComponent,
KeypadComponent
],
imports: [
BrowserModule,
CommonModule,
MainModule,
routing
],
bootstrap: [AppComponent]
})
export class AppModule { }
main.module
import { NgModule } from '@angular/core';
import { routing } from '../app.routing';
import { ProductComponent } from './product/product.component';
@NgModule({
imports: [
routing
],
declarations: [ProductComponent]
})
export class MainModule { }
My issue is that when I try to call the Keypad Component in product.component.html
, it will give me an error that says it does not exist. However, when I call it in my main.component.html
, it works fine.