import { ModuleWithProviders , NgModule } from '@angular/core' ; import { CommonModule } from '@angular/common' ; import { NotificationsService } from '../services/notifications.service' ; @ NgModule ( { declarations : [ ] , imports : [ CommonModule ] , } ) export class ServicesModule { static forRoot ( ) { return { ngModule : ServicesModule , providers : [ NotificationsService ] , } ; } }