Hi im new at angular 2 and Im trying to put in place all the things I have learned in angular.io. The problem is that I have readed about the core module, services, injectables ... and
If I have lets say a core-module like this:
import { NgModule } from '@angular/core';
import { LoggerService } from './services/logger.service';
@NgModule({
exports: [
//components
LoggerComponent,
],
declarations: [LoggerComponent],
providers: [LoggerService],
})
export class CoreModule { }
and a simple app.module like:
import { CoreModule } from './core/core.module';
import { AppComponent } from './app.component';
@NgModule({
imports: [
CoreModule,
BrowserModule,
HttpModule,
routerModule,
],
declarations: [
AppComponent,
],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule { }
How can I use the LoggerService service exported for the core-module? i have to
import {LoggerService} from './core/services';
in my app.component? because in the contructor of app.component its not working
constructor(logger: LoggerService){}
what Im missing? thanks!