title: How to import a service from another module in Angular 6
body: <p><strong>Tech</strong>: using angular 6, angular cli and typescript.</p>
  
  <p><strong>Scenario</strong>:</p>
  
  <p>I have an <strong>app module</strong> and a <strong>core module</strong></p>
  
  <p>I want my app modules components to use the services from my core module.</p>
  
  <p><strong>My core module contains a list of services:</strong></p>
  
  <pre><code>import { NgModule } from '@angular/core';
  
  // Services
  import { AuthService } from './services/auth.service';
  
  @NgModule({
    declarations: [
    ],
    imports: [
    ],
    providers: [
      AuthService
    ]
  })
  export class CoreModule { }
  </code></pre>
  
  <p><strong>This is my app module:</strong></p>
  
  <pre><code>import { BrowserModule } from '@angular/platform-browser';
  import { CommonModule } from '@angular/common';
  import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
  import { NgModule } from '@angular/core';
  import { ReactiveFormsModule, FormsModule } from '@angular/forms';
  import { RouterModule } from '@angular/router';
  
  import { AppComponent } from './app.component';
  
  // Modules
  import { CoreModule } from './core/core.module';
  
  // Sections
  import { COMPONENTS } from './components/index';
  import { ROUTES } from './app.routes';
  
  @NgModule({
    declarations: [
      AppComponent,
      COMPONENTS
    imports: [
      CommonModule,
      FormsModule,
      BrowserModule,
      HttpClientModule,
      ReactiveFormsModule,
      RouterModule.forRoot(ROUTES),
      CoreModule
    ],
    providers: [
    ],
    bootstrap: [ AppComponent ]
  })
  export class AppModule { }
  </code></pre>
  
  <p><strong>Note:</strong> As you can see, I'm importing the CoreModule.</p>
  
  <p><strong>This is my component from the app module (its calling the core module to get the AuthService):</strong></p>
  
  <pre><code>import { Component } from '@angular/core';
  
  // This Auth Service import not working (says service not exported)
  import { AuthService } from '../../core/core.module';
  
  @Component({
    selector: 'app-contact',
    templateUrl: './contact.component.html'
  })
  export class ContactComponent {
  
    constructor(
      private authService: AuthService
    ) {}
  }
  </code></pre>
  
  <p><strong>Issue</strong>: I'm trying to import a service into my app modules component called contact component like so:</p>
  
  <pre><code>import { AuthService } from '../../core/core.module';
  </code></pre>
  
  <p><strong>Error I get:</strong></p>
  
  <p>Service not an exported member of core module.</p>
  
  <p><strong>Outcome:</strong> I want my contact component from app module to import the core module service called AuthService.</p>