module-federation-examples icon indicating copy to clipboard operation
module-federation-examples copied to clipboard

angular11-microfrontends-lazy-components | styles not getting applied for shared component

Open hardikpatel043 opened this issue 3 years ago • 6 comments

image

I was trying to run one of the example of angular.

I observed that styles of shared component "lib-mdmf-shared" are not applied when I run shell or profile app.

image

Any solution to this?

hardikpatel043 avatar May 04 '21 07:05 hardikpatel043

likely a design issue but i dont know angular unfortunately In react is was because the shell needed to share the style vendor or some service as well as expose it to the shell itself depends on it

ScriptedAlchemy avatar May 19 '21 22:05 ScriptedAlchemy

Did you rebuild mdmf-shared?

ydmitry avatar May 19 '21 23:05 ydmitry

This is not working because module federation with Angular CLI 11 doesn't support styleUrl in component.

image

Putting styles in html as below worked.

image

However, this issue is fixed with Angular 12.

@ScriptedAlchemy Do you want me to upgrade all angular examples to angular 12? I would love to contribute.

hardikpatel043 avatar May 30 '21 07:05 hardikpatel043

@hardikpatel043 if you do update the example you'll need this: https://github.com/angular-architects/module-federation-plugin/issues/36

smasala avatar May 31 '21 15:05 smasala

Yes please any updates that need to be made should be. I don't really use angular so I don't know how to fix them if they break.

Happy to accept PRS

ScriptedAlchemy avatar May 31 '21 16:05 ScriptedAlchemy

I can confirm styleUrls works perfectly fine, not sure what the issue is here. I'm currently using Angular 11. Either way getting an update to Angular 12 would be awesome.

edarioq avatar Jun 02 '21 14:06 edarioq