Skip to content

ngAfterViewInit and ngOnInit not called #1

@HeneryHawk

Description

@HeneryHawk

Hi @manfredsteyer,

thanks for your example and information about Module Federation in the context of Micro Frontends.
I have packaged an app as an Angular element in one of my projects to include it in another app. Since these two app use different Angular versions, the only way was through Web Components and Angular Elements.

App A, which is included as a microfrontend, uses ngOnInit and ngAfterViewInit in one of the components. These two hooks are called as usual when the app is included in the shell.
However, when I start App A standalone to develop, for example, these two hooks are no longer called.

Why is this?

I have used your app angular-app1 here and built an example where the error can be reproduced.
https://github.com/HeneryHawk/micro-frontend-module-federation -> b.component.ts

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions