elesh.j
elesh.j

Reputation: 344

Sharing Navigation between Angular Apps

I am considering using angular in a enterprise environment. Thinking forward, we will have multiple applications. Does angular support using multiple applications and sharing components. For example, can I share a Navigation component?

Update (2/1/19): I wanted to add my method to attempt shared navigation, and I will also explain where I am currently stuck.

I have two projects:

1) I created an Angular Library ([see here][1]) that has a menu component. I will use this component to share the menu with an Angular project (project-a). I can add the navigation component to project-a by putting the selector in my app.component.html:

2) My Angular Project (project-a)

In designing my-menu, I'd like to use angular routing. My question is: In my library's router, how can I reference a component that is in project-a. project-a is in a different workspace.

Upvotes: 0

Views: 654

Answers (2)

ozz
ozz

Reputation: 5366

My company does this and wraps them up as npm packages in our own private npm feed.

Upvotes: 1

Andy Lamb
Andy Lamb

Reputation: 2221

You could provide the URLs to navigate between apps via an API called from all apps. It would be more flexible than purely Angular options such as a shared package containing the URLs.

Upvotes: 0

Related Questions