I've achieved a solution though couldn't find a SSA way of doing it.
So it turns out, SSA features can be overridden in a usual angular way i.e. the way you would make two sibling components interact with each other in regular angular code.
This is what I did:
- Created a shared service with Subject and Behavior from reactive javascript (rxjs) i.e.
@Injectable()
export class DataSharedService {
constructor() {
this._instance = Data.singleton();
}
_instance: Data = null;
singleton(): Data {
return this._instance;
}
public sendMessage(message:any) {
this._instance.sendMessage(message);
}
public getMessage() {
return this._instance.getMessage();
}
and then subscribed to the method in sibling components like below:
Component 1:
$this.dataSharedService.sendMessage(feature.N);
Component 2:
this.dataSharedService.getMessage().subscribe(message => {
....