Within this particular Namespace, I am exporting a Rx subject of the string data type:
namespace something.TaskHandling {
export const selectedTask$ = new Rx.Subject<String>();
Inside my TaskListComponent
class within the something.TaskHandling.Overview
namespace, I have the following:
public clickListItem() {
selectedTask$.onNext('responsive-view-filters');
}
Furthermore, in my ResponsiveNavigationComponent
located in the something.CustomerService
namespace, I am importing the previously defined subject:
import selectedTask$ = something.TaskHandling.selectedTask$;
The stream is initialized within my OnInit
method:
public $onInit() {
this.observeTaskUpdates();
}
private observeTaskUpdates(): void {
selectedTask$
.filter(classValue => !!classValue)
.subscribe(classValue => {
this.toggleView(classValue);
});
}
All seems to be well during compilation, but upon running the application, I encounter the following error message in ResponsiveNavigationComponent.ts:
TypeError: Cannot read property 'filter' of undefined
It appears that the selectedTask$
is not defined within the ResponsiveNavigationComponent
class. What could potentially be missing from my setup?