joeldenning / simple-single-spa-webpack-example

A simple example of how to use webpack with single-spa
MIT License
293 stars 95 forks source link

Unable to switch between multiple angular apps #12

Open sri1980 opened 6 years ago

sri1980 commented 6 years ago

i am trying to load multiple angular apps (1.x, 4, 6 versions) using single-spa framework.

registerApplication('app1', () => loadApp('index.html path') , pathPrefix('/app1')); registerApplication('app2', () => loadApp('index.html path') , pathPrefix('/app2'));

function loadApp(url) { return new Promise((resolve, reject) => {

  //load all polyfills, vendor, main js files

   var script = document.createElement("script");
   script.type = "text/javascript";
   script.src = "polyfills-bundl.js";  
   document.head.appendChild(script);

}); }

app1 loads successfully, if i try to load 'app2' it doesn't work. it is the same way for app2.

Can you please help me what is the issue here?

Does single-spa-webpack-example supports to load different angular version apps?

joeldenning commented 6 years ago

What error are you seeing when app2 doesn't work?

see https://github.com/CanopyTax/single-spa-angular/issues/4 for more info on loading multiple angular versions in the same page

sri1980 commented 6 years ago

Thanks for your response. I am not seeing any error. Url is getting changed with route appending to base url, but nothing happens in the browser. Please let me know is there any additional details I can provide to help me on this.

Thanks again

joeldenning commented 6 years ago

Are you using the code in simple-single-spa-webpack-example, that uses https://github.com/CanopyTax/single-spa-angular? Or are you using https://github.com/PlaceMe-SAS/single-spa-angular-cli?

sri1980 commented 6 years ago

I am using simple-single-spa-webpack-example