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

Feature: simplify subapplication's definition #58

Closed
why520crazy opened this issue Dec 25, 2019 · 0 comments
Closed

Feature: simplify subapplication's definition #58

why520crazy opened this issue Dec 25, 2019 · 0 comments
Assignees
Labels
need to discuss Need to discuss

Comments

@why520crazy
Copy link
Member

why520crazy commented Dec 25, 2019

Now, we define a subapplication as:

defineApplication('app1', (portalApp: PlanetPortalApplication) => {
    return platformBrowserDynamic([
        {
            provide: PlanetPortalApplication,
            useValue: portalApp
        }
    ])
        .bootstrapModule(AppModule)
        .then(appModule => {
            return appModule;
        })
        .catch(error => {
            console.error(error);
            return null;
        });
});

Expect define as:

defineApplication('app1', {
   platformRef: platformBrowserDynamic(),
   AppModule: AppModule,
   // or 
   bootstrap:(options) => {
     return platformBrowserDynamic()
        .bootstrapModule(AppModule)
        .then(appModule => {
            return appModule;
        })
   }
   template: `<app1-root></app1-root>`
   Router: Router,
  // ... and somethings
});

at present, it is not appropriate to determine how to define API, look forward to your good suggestions.

The single-spa for Angular as below:
https://github.com/CanopyTax/single-spa-angular/blob/master/src/browser-lib/single-spa-angular.ts

image

@why520crazy why520crazy added the need to discuss Need to discuss label Dec 25, 2019
@luxiaobei luxiaobei self-assigned this Jan 14, 2020
walkerkay added a commit that referenced this issue Nov 9, 2020
* feat(global-planet): simplify subapplication's definition #58

* fix(global-planet):  create app element by custom template

* test(application-loader): add custom template test

* test(application-loader): test cutom template hideApp

* test: change TestBed.get to TestBed.inject
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need to discuss Need to discuss
Projects
None yet
Development

No branches or pull requests

2 participants