How to call component method from service? (angular2)

Interaction between components can be indeed achieved using services. You will need to inject the service use for inter-component communication into all the components which will need to use it (all the caller components and the callee method) and make use of the properties of Observables. The shared service can look something like this: import … Read more

Getting instance of service without constructor injection

In the updated Angular where ngModules are used, you can create a variable available anywhere in the code: Add this code in app.module.ts import { Injector, NgModule } from ‘@angular/core’; export let AppInjector: Injector; export class AppModule { constructor(private injector: Injector) { AppInjector = this.injector; } } Now, you can use the AppInjector to find … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)