joeldenning / simple-single-spa-webpack-example

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

unable to get Angular1 component to load in this webpack example #3

Closed boskya closed 6 years ago

boskya commented 7 years ago

Hi, I used a angular 1 component (copd it from simple-spa-examples) and add angular1 + router dependencies to package.json. And although the code builds and loads (I see it go into boostrap), the components don't seem to load. Are angular 1 + webpack + single spa supposed to work together or does single spa need systemJs?

boskya commented 6 years ago

It seems to work with ui-router but just a plain old component needs modification to allow for a template.

joeldenning commented 6 years ago

Oops, this issue slipped out of my radar when you originally created it. Angular1 + webpack + single-spa indeed are supposed to work together without SystemJS. In fact, a couple of companies use single-spa-angular1 in production.

However, I think most of the time single-spa + angular1 has been tested with ui-router. So you trying it out without ui-router might be the first time someone has done that. I will take a look at this -- might be a bug in single-spa-angular1

joeldenning commented 6 years ago

@boskya I got angular 1 without ui-router working! Check out https://github.com/joeldenning/simple-single-spa-webpack-example/compare/angular1 and https://github.com/CanopyTax/single-spa-angular1/releases/tag/2.5.0 (I updated something in single-spa-angular1 for it). When you are not using ui-router, it's necessary to provide an html template to single-spa-angular1 since the router won't be putting its own template onto the DOM. Feel free to pull down the angular1 branch of this project and try it out on your own!

Let me know if you have any questions about the code, or anything else! And feel free to reopen if there are still issues.

boskya commented 6 years ago

@joeldenning Thank you that was quick. I will try it out.