Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing service between App and plugins #21

Open
jano42 opened this issue Nov 19, 2019 · 0 comments
Open

Sharing service between App and plugins #21

jano42 opened this issue Nov 19, 2019 · 0 comments

Comments

@jano42
Copy link

jano42 commented Nov 19, 2019

Your work is amazing. (I've already search for such plugin system without finding a really good architecture.)

I'm relatively new to angular, and I don't master enough depecndencies injection with your example.

I just would like to go further than sharing components with plugins. What I want is to share a service (so my plugins could interact with app; it two ways : having methods to call app features; or being notified from app).

Here are headline of what I would like to do :

The serviceInterface :

export interface ISharedService{
    //the Obersable/event the plugin can register/subscribe to
    notificationEvent: Observable<string>;

   //a method call by plugins and executed on app
    doSometing(): void;
}

A plugin example:


  constructor(private sharedService: ISharedService) {
    this.sharedService.notificationEvent.subscribe( message => {
      
    });
  }

The service must be implemented on app side

Could it be realizable by the plugin architecture ?
I've tried without success, but my skills are limited on such project (I've tested with the branch share-lib-between-app-and-plugins)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant