What is the scope of an Angular module Import

Viewed 7466

If I have three modules

  1. AppModule
  2. SharedModule
  3. ItemModule

Inside the SharedModule I have a PaginatorComponent that is exported as follows:

shared.module.ts

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { PaginatorComponent } from './paginator/paginator.component';

@NgModule({
  imports: [
      CommonModule
  ],
  declarations: [
      PaginatorComponent
  ],
  providers: [],
  exports: [
      PaginatorComponent
  ]
})
export class SharedModule { }

I then import the shared module into my AppModule using the lines

app.module.ts

import { SharedModule } from './shared/shared.module';

imports: [
      ...
      SharedModule,
      ...

Question; Should my third "ItemModule" automatically have access to the PaginatorComponent or do I need to import directly into the 3rd module? Currently I get a variation of the generic error:

Can't bind to 'totalItems' since it isn't a known property of 'app-paginator'.
1. If 'app-paginator' is an Angular component and it has 'totalItems' input, then verify that it is part of this module.

Many thanks.

2 Answers
Related