0

I have two Angular projects. One is called App1, and other is Angular Form Editor. I want to embed Form Editor into App1 (project). How can I do this?

4
  • in Angular 2 you should use Angular 2 modules. If you want to build Angular 2 app into another Angular 2 app you can use the first Angular 2 app as an Angular 2 module and then import it in a second Angular 2 app Commented Sep 28, 2017 at 5:10
  • So I need first to create the FormEditor App as angular2 module in my App1 project?Any example please mentioned the link. Commented Sep 28, 2017 at 5:22
  • How are they supposed to communicate with each other? Commented Sep 28, 2017 at 5:28
  • Right now I want just to embed interface of form-editor into App1.After this I will right back-end for it.So it will communicate with each other.My requirement right is to use form-editor interface into App1. Commented Sep 28, 2017 at 5:40

1 Answer 1

1

Build a module with App2.

This can be a complex task but there are plenty of templates out there you can use. I created this minimal module template - feel free to use it: https://github.com/angular-patterns/ng-module-template

Then create an app with App1 and import the App2 module. Make sure to declare the component from the App2 module.

import 'App2Module' from 'App2Module';

@NgModule({
    imports: [App2Module],
    declarations: [App2Component]
})

If you also need an app template, here is one:

https://github.com/angular-patterns/ng-app-template

It uses @ngtools/webpack for the AoT buld.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.