I use Angular 2. I use singleton service @NgModule({}) in section providers: ['MenuService'] I use MenuService.
MenuService looks as: @Injectable()
export class MenuService {
  constructor(private userService: UserService, private i18nService: I18nService) { console.log('Called'); }
}
There are two components where I inject this service:
export class HeaderComponent {
  constructor(private menuService: MenuService) {}
}
export class HomeComponent {
  constructor(private menuService: MenuService) {}
}
I see console.log('Called'); twice, why is it called repeatly?
 
     
     
    