I want to manipulate the value of some local variables from the service which a component calls .
Yes , it can be done by subscribing(in component) to an Observable (in service) but i don't want to add anything in the component .
updating variable changes in components from a service with angular2
which proposes this :
component {
service.subject.subscribe (_=>{--do stuff here --})
}
Service {
subject() -- An observable --
}
I want the service to be responsible for setting some of my local variables (in component) .
Something like this :
Service -- > Call some component' variable and set it !
Can this be done ? If yes then how ?