I create an angular library "mylib"
I create a service which uses BehaviorSubject Observable from rxjs.
For example
currentLanguage = new BehaviorSubject(null);
I have a component in mylib, which will set the language on change event on a select input.
this.myService.currentLanguage.next('en');
After building "mylib" and use in myapp... I can subscribe to myService from myapp.
If I change the value on the select input, I can see the event, yet, there is no next value sent to the BehaviorSubject and no error in the console. So I can't emit value change from the component of mylib.
Yet... if from myapp I emit a next value.. it work...
So my question is why from a component of a custom angular library it's not possible to to use "next" yet it is from the component which use the library... and it's possible from any component of the app which import the library service ?
Maybe it can be related to the @NgModule in mylib.module.ts, it's possible that I have to import rxjs in imports Array ? I try to
imports: [CommonModule, FormsModule, BehaviorSubject]
make error
an idea ? :)
Thank's
Mike
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)