4

I have an existing Angular app using TypeScript and Angular-CLI version 1.7. Now I want to embed the entire angular application inside of a parent react application. Such as when a specific route is reached in the react app, it should render the angular app and that URL will become base-href for the angular app and routing inside angular app should work. Also, it should remain as a Single Page Application that it was.

I was looking out for a solution in which I could do

class AngularComponent extends Component {
    componentDidMount() {
        platformBrowserDynamic().bootstrapModule(AppModule);
    }

    render() {
        return <app-root><app-root>;
    }
}

I am not sure how I can import AppModule with all its functionalities in a React Component class.

Himanshu Chauhan
  • 1,181
  • 7
  • 10
  • https://medium.embengineering.com/micro-front-end-and-web-components-ce6ae87c3b7f – Lazar Nikolic Sep 17 '18 at 09:21
  • The routing is not supported in web components and I don't want to use redirection because then it doesn't live as a single page application. I've also tried single-spa, but somehow it doesn't work when parent app is created by create-react-app and child app is in angular. Can you suggest something else other than web components and single-spa? – Himanshu Chauhan Sep 17 '18 at 09:45
  • @HimanshuChauhan Were you able to achieve this thing? If yes, then please help me out. I also have similar kind of usecase – monica Feb 14 '23 at 11:18

0 Answers0