Hi Scott,

Unless you provided the services elsewhere, they are singletons. I suspect 
that you are using primitives. As primitives are assigned by value and not 
by reference.

import { Injectable } from '@angular/core';

@Injectable({ providedIn: 'root' })
export class test1Service {
public someVar = '100';
constructor() {}
}

@Injectable({ providedIn: 'root' })
export class test2Service {
someRef = this.t.someVar;
constructor(private t: test1Service) {}
}


If you have something like that, the someRef will never updates, as it 
copies the value. A solution might be using a getter:

@Injectable({ providedIn: 'root' })
export class test2Service {
someRef = () => this.t.someVar;
constructor(private t: test1Service) {}
}

someRef is now a function that will return the current value.

Hope this helps,
Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to