Angular Sharing Components

29 views
Skip to first unread message

Damien Gallagher

unread,
Jun 11, 2019, 4:41:16 PM6/11/19
to Angular and AngularJS discussion
Hi

We are just about to start developing a new angular app.
We want to develop components that can be used in other angular apps within our organisation.

The apps / components we create will initially be for our consumption but will quickly be used by other teams.
We want developers on our team to work in isolation in these components and be able to version their work in artifactory.

What is the best approach for this way of sharing components?
Would libraries be the way to go?

Thanks
Damien

Tito

unread,
Jun 11, 2019, 6:44:47 PM6/11/19
to Angular and AngularJS discussion
Maybe creating your own internal repository like npm does. And you want each team to have a version of their own for the sae component, sounds like that would defeat the purpose of shared components to me?

Sander Elias

unread,
Jun 13, 2019, 5:04:02 AM6/13/19
to Angular and AngularJS discussion
Hi Damien,

Start with an "empty" shell/demo/kitchen-sink app, in which you can pull in "dynamic" HTML.
Then use the CLI to create libraries, and use NPM to publish those. You might need a private NPM namespace or your own in-house NPM(like) server.
The big win of this way is that all tooling is already geared towards this way of working.
Decide if you want to push out single elements, or small libs.

When I'm working on a new thing, I'll first create it in the shell app, build a small demo/test for the thing. This way I can easily build/iterate on it. When it's ready, I'll move it over to a library. 
(you can build it in a library from the get-go, but it takes way more steps to test, iterate then)

Create those elements as Angular Elements (this is optional, but it will pay off in the long run.)
Reply all
Reply to author
Forward
0 new messages